Does TanStack (React) Query work with the Next.js App router (React Server Components) #5725
Replies: 4 comments 1 reply
-
https://tanstack.com/query/v4/docs/react/guides/ssr#using-the-app-directory-in-nextjs-13 |
Beta Was this translation helpful? Give feedback.
-
Hey @TkDodo, Tanstack Query will not work in React Server Components? |
Beta Was this translation helpful? Give feedback.
-
Well, |
Beta Was this translation helpful? Give feedback.
-
Hey @TkDodo how are you, i was wondering whether i could use SSR prefetch in the Advanced Server Rendering example in the RootLayout it self, or if their is any work around to use tanstack on the rootLayout, thanks in advance and for all your work! Currently reading the example code and i noticed:
so in theory i should be able to use makeQueryClient() on the RootLayout and use prefetching hooks as normal which would look like:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Can I query my data in Server Components with TanStack Query?
Beta Was this translation helpful? Give feedback.
All reactions