angular.js - React-redux app scroll bar position record?
PHPz
PHPz 2017-05-15 16:59:11
0
1
776

When developing a single-page application, the scroll bar will always maintain a fixed position when switching pages. Now scroll-behavior is used to solve this problem and can also record the scroll bar position of the previous page, but it If asynchronous is not supported, do you guys have a good solution?

PHPz
PHPz

学习是最好的投资!

reply all(1)
大家讲道理

For such a requirement, it is indispensable to maintain the scroll bar position as state.
The remaining method that can be thought of is to use the API provided by react router, onEnter to prefetch the data and set the redux store, and the table will automatically fill the data according to the store. In this way, when the page render is completed, setting the scroll bar position is completely no problem.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template