Can I use tRPC with Next.Js App Router

I want to know if there's a way I can use tRPC with Next.Js app router. I mean, I don't want to use it in server components but inside client components to have the tRPC magic in them.
5 Replies
m$
m$2y ago
I think we are all patiently waiting for t3 stack to be updated with app router...
celeroncoder
celeroncoderOP2y ago
Ah... I wasn't following the t3 stack news for a while but it's possible right?
m$
m$2y ago
Theres probably nothing stopping you, just waiting for t3 stack to accommodate it and maybe TRPC to make changes for RSC etc
m$
m$2y ago
been keeping a close eye on this issue: https://github.com/t3-oss/create-t3-app/issues/1364
GitHub
feat: experimental appDir option and migration guide · Issue #1364 ...
Is your feature request related to a problem? Please describe. New features from Next.js 13 do not work with t3 app Describe the solution you'd like to see Create t3 app with appDir structure, ...
ja_iy
ja_iy2y ago
I'm trying using it using this approach https://github.com/trpc/next-13/blob/3992fb41ec4b1134d596d94007fdea51453445dd/client/trpcClient.tsx, seems to be working fine just add it to your root layout where appropriate
Want results from more Discord servers?
Add your server