Ali Samadi
Ali Samadi2w ago

trpcClient

Is this way recommended or stable that we can save the trpcClient outside of the provider and access it easily? Like image 2
No description
No description
2 Replies
Ali Samadi
Ali SamadiOP2w ago
What about storing the const trpc = useTRPC(); in the top level of the app. So I don't need to call the hook everytime.
Nick
Nick2w ago
Generally fine, but I think if you're doing SSR/RSC there may be footguns there. I'm no expert in that area though

Did you find this page helpful?