我对 React/Redux 是全新的。目前,我正在开发一个 React/Redux 项目。
有一个要求。
When user browse from one page to another and whenever the user come back on previous page by browser back button, page location(scrollY) should be there from where they left.
抱歉,由于保密协议(protocol),我无法共享任何代码
有人可以指导我使用 React/Redux 实现这一目标的最佳方法吗?
谢谢
最佳答案
考虑使用react-router
,它提供了开箱即用的此功能。
编辑:看来浏览器现在开始在使用 history.pushState
时原生支持这一点(这就是 react-router
使用),所以如果您只是遵循 basic教程,它应该适合您的情况。
关于javascript - React Redux - 当他们返回该页面时如何在特定位置使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46943079/