qqxu
3/12/2018 - 9:12 AM

scroll to top of the page when we use react router

scroll to top of the page when we use react router

  1. onUpdate used to scroll to top of the page
<Router onUpdate={() => window.scrollTo(0,0)} history={hashHistory}>

...

</Router>