Closed KATT closed 2 years ago
I did see that in the docs but was unsure of the reason.
This will be problematic when SSRing because the same TRPCClient will be used for all requests.
Could you elaborate on why this is problematic? Also note that this package doesn't do any special SSR logic like @trpc/react
does. The only SSR you'll get with this package is through server side suspense.
Examples:
headers:
on the instance will be global for all requests in the appAh ok that makes sense. I'll fix the readme.
The readme currently tells you to create a global tRPC client instance.
This will be problematic when SSRing because the same TRPCClient will be used for all requests.
Instead, create the client in a
useState(() => ...
callbackRelated: