weixin_33697898 2016-06-08 01:21 采纳率: 0%
浏览 203

React.js滚动页面到顶部

What is the default behavior in React for scrolling when the route changes? I read multiple posts that suggest you add prop to the router only to override the default behavior of scrolling to the top. In my application I don't see this behavior, when I visit some routes from footer of the app, the browser does not scroll to the top so I had to add javascript in those components to scroll to the top but I might come across this on other pages also, so wondering what is the best way to handle this. Is there global solution I can implement on my single page app?

  • 写回答

0条回答 默认 最新

    报告相同问题?