-
With I believe a similar code example would make a strong addition to https://tanstack.com/query/v4/docs/guides/ssr. Given that it relies on experimental features, it would need to come with a caveat that it could break in a future non-major release. Welcome any feedback on my implementation. I'm not sure if |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
It's not needed, it can be garbage collected because we don't start the timers anymore on the server since v4. the thing is, I don't think we need hydration with fetches located at component level. One approach is to fetch on the server, then pass the data down to a the client component with The concept is described here on twitter: https://twitter.com/lukemorales/status/1585506850421854210 I think it's pretty good and until we have figured out how hydration will work (if at all) in next13, this should be the approach we document. |
Beta Was this translation helpful? Give feedback.
-
have to handle fetching data such as after clicking the button? |
Beta Was this translation helpful? Give feedback.
-
I did POC with Nextjs 13 app dir. Have a look please POC example |
Beta Was this translation helpful? Give feedback.
It's not needed, it can be garbage collected because we don't start the timers anymore on the server since v4.
the thing is, I don't think we need hydration with fetches located at component level. One approach is to fetch on the server, then pass the data down to a the client component with
initialData
. It will also work nicely on type-level because data will always be defined. It's very similar to what react-router v6.4loaders
are doing.The concept is described here on twitter: https://twitter.com/lukemora…