单页应用切换路由的时候,需要回到页面顶部
提供相关的配置项,比如 scrollTop: true
react-router 推荐的做法是在路由组件生命周期里写 window.scrollTo(0, 0)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
react-router 推荐的做法是在路由组件生命周期里写
window.scrollTo(0, 0)