Open mmontag opened 3 years ago
What's the best way to restore scroll position on navigation back/forward with this library?
Would it be a matter of setting options.initialState.firstItemIndex, or storing position somewhere and calling the DOM API element.scrollTo(x, y)?
options.initialState.firstItemIndex
element.scrollTo(x, y)
I am using React router for client-side navigation. (Their notes on scroll restoration: https://reactrouter.com/web/guides/scroll-restoration)
What's the best way to restore scroll position on navigation back/forward with this library?
Would it be a matter of setting
options.initialState.firstItemIndex
, or storing position somewhere and calling the DOM APIelement.scrollTo(x, y)
?I am using React router for client-side navigation. (Their notes on scroll restoration: https://reactrouter.com/web/guides/scroll-restoration)