Rule
Rule14mo 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
wleistra14mo ago
I would also like to know what the best way is
noahsolomon
noahsolomon14mo ago
same
gui
gui14mo ago
Same.
markit
markit13mo ago
same 🤷‍♂️
TkDodo 🔮
TkDodo 🔮13mo 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.