boneyB
tRPC3y ago
2 replies
boney

tRPC Client within Next.js but with external standalone server?

Hi,

I have an old Next.js project that used tRPC and we're currently in the process of separating out the frontend and backend parts of it for various reasons. To reuse code, I was hoping to set up a standalone tRPC Server

In that case, what's the recommended method of setting up a tRPC Client on the Next side? using @trpc/next or @trpc/react ?

I tried (briefly) using @trpc/next and it was giving me issues around not having a
QueryClient
set - but im not sure if the react method is the way to go either.
Was this page helpful?