How do I prefetch trpc serverside and then hydrate the client?

Wondering how to do this with the t3 stack. Haven’t found anything in the docs about how to prefetch on server and then hydrate the client from then on! Any hints, links or repos?
2 Replies
FluX
FluX6d ago
You are probably looking for this https://trpc.io/docs/client/react/server-components
Set up with React Server Components | tRPC
These are the docs for our 'Classic' React Query integration, which (while still supported) is not the recommended way to start new tRPC projects with TanStack React Query. We recommend using the new TanStack React Query Integration instead.
BouncerU
BouncerU6d ago
Server-Side Helpers | tRPC
The server-side helpers provides you with a set of helper functions that you can use to prefetch queries on the server. This is useful for SSG, but also for SSR if you opt not to use ssr: true.

Did you find this page helpful?