Skip to content

achieving ppr on nextjs with react query #9196

Answered by TkDodo
younes101020 asked this question in Ideas
Discussion options

You must be logged in to vote

why not do this with hydration and sending non-awaited promised down like shown in the docs?

https://tanstack.com/query/v5/docs/framework/react/guides/advanced-ssr#streaming-with-server-components

the problem with initialData is that it will be ignored if there is data in the cache already, but the fetch on the server will start every time you navigate to the page. hydration solves this because it can overwrite existing data in the cache.

Replies: 1 comment 1 reply

Comment options

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

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