Skip to content
Discussion options

You must be logged in to vote

scroll restoration is a feature of the browser. It defaults to auto, which means:

The location on the page to which the user has scrolled will be restored.

The problem with many client rendered applications is that once you go back, the data you viewed is "lost". You'll see a brief loading spinner, followed by your data. That is enough for the browser to not be able to scroll to the previous scroll position.

So the only thing that react-query does here is to instantly render data from the cache, which should be enough to make scroll restoration work.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@spacepolice10
Comment options

Answer selected by spacepolice10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants