Rule
Rule15mo ago

tRPC with with react-query prefetching in Next.js app directory.

Hi. What is currently the best way to do prefetching in Next.js app directory when using @tanstack/react-query and Next.js app directories?
5 Replies
wleistra
wleistra15mo ago
I would also like to know what the best way is
noahsolomon
noahsolomon15mo ago
same
gui
gui15mo ago
Same.
markit
markit15mo ago
same 🤷‍♂️
TkDodo 🔮
TkDodo 🔮15mo ago
We have an excellent new guide in the v5 docs: https://tanstack.com/query/v5/docs/react/guides/ssr
Server Rendering & Hydration | TanStack Query Docs
In this guide you'll learn how to use React Query with server rendering. See the guide on Prefetching & Router Integration for some background. You might also want to check out the Performance & Request Waterfalls guide before that.

Did you find this page helpful?