How to scroll to top every time React router change?
How to scroll to top every time React router changed?
First, create a component to handle scroll event like this:
If you'd like to use a class component:
Second, import your scroll-top component and put it at the top of your app, but inside Router
First, create a component to handle scroll event like this:
If you'd like to use a class component:
Second, import your scroll-top component and put it at the top of your app, but inside Router
Latest
© 2019 4codev
Created with love by Sil.