`createCaller` and RSC - with next-auth
I've been upgrading my trpc routers and handlers to support edge+app router with drizzle and next-auth; and something that has come up is the use of createCaller (with createTRPCNext instead of createTRPCReact - and without the TRPCProvider). So I wanted to ask if this is a correct way of using that function
4 Replies
so with that I'm using it in RSC pages like this
I'm wondering if returning/creating the caller on every RSC is a good practice, because I read that it's possible that it may execute all middlewares and validations again
It only executes the middlewares on the route you call
so it's safe to use like this, right?
Yes