tRPC- Nextjs app directory client & server components help to understand best approach
Hello 🙂 I have used tRPC in few projects with Nextjs in the past with the page router and hoc withTrpc but I am having few problems to understand how switch to the app router. By my understanding withTrpc is not suitable for app router. In the avail tRPC examples the RootLayout is wrapping the children into a trpc context provider (client component) which by my understanding eliminates the possibility of using SCR from the beginning (which seems bit weird to me). I have found the trpc playground app-directory repo but the layout context seems still a under definition. For a production project ( will need to stably run for a few years with no major updates) which way should I go? pages router + withTrpc, app dir + client context, predisposed server context + scr? Thank you!
0 Replies