A tool that make it return to top when refreshing the current page or jump to another page.
v2.0.0 comes!!!
This time, here comes ScrollToTop
component which can work in react app.
⚠ If you are using React Router Dom for navigation and routing in your React app then you will have to handle scroll restoration on your own because the library no longer ships default scroll management (it used to provide an out-of-the-box solution in the past).
refreshToTop
: Just add this to your js file orscript
tag.RefreshToTop
: Just add this component as the child of the router.👇
<Router>
<RefreshToTop>
...
</RefreshToTop>
</Router>
Follow me at GitHub, Thx!🙏