Skip to content

mudssrali/dynamic-scroll-to-top

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Dynamically Scroll to Top

Dynamically scroll to top in React JS components. Handling the scroll position in a react app on route change

Usage

Just import the component, use like other components

import DynamicScrollToTop from `DynamicScrollToTop.js`
return(<DynamicScrollTop scrollType="smooth" />);

One liner solution of Above Solution

// react's hook
useEffect(() => {
    window.scroll(0, 0)
})

For more details Visit Dynamically Scrol to Top - Original

Note: Below are the links for more details on location and scroll

About

Dynamically scroll to top in React JS components

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors