Do we need to use initialData to get hydrated data? #2264
Unanswered
intelcoder
asked this question in
Q&A
Replies: 1 comment
-
according to the docs, it should be either hydration or manually passing initial data. please provide a codesandbox, then I can take a closer look |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I am currently trying to set up server-side rendering with the custom Webpack setup.
Everything seems to work as expected except one part.
<Hydrate state={dehydratedState}>
When it hydrates with state I was expecting useQuery to pick up the data from the cache automatically. However, it seems I need to get the data manually using initialData option like below.
initialData: () => queryClient.getQueryData(['xxx', id]),
Is there a way to setup the way it automatically gets data on load if data is preloaded on a server?
Beta Was this translation helpful? Give feedback.
All reactions