Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
2 replies
Gabriel

Correct way to fetch data in a server component and pass it to a client component? ReactQuery TRPC

Hi, I want to understand what are the best practices to deal with TRPC and react server components. Say that I want to have a server component that fetches data in the backend using trpc.

I understand that if I am in the server I should use createCaller method from trpc. I tried to do it like so, and pass the data I fetch from the caller to my client component:
Was this page helpful?