Skip to content
Discussion options

You must be logged in to vote

Let's say the user scrolled to page 4, clicks on a component and navigates away/or refreshes the page.
When the user returns to the page, the SSR will run and the queryClient will prefetch the data with default limit and dehydrate it to send it to the client.
This will swap out the cache with the same query key in the client side, resulting the data to reset to page 1. Hence, the scroll position is out of sync.

You probably shouldn't SSR when you have data in the cache on the frontend already. This is not so easy to get done with nextJs, there is a lengthy discussion going on here with some workarounds:

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by json9512
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