T
tRPC

How to use NextJS tRPC client without hooks?

How to use NextJS tRPC client without hooks?

Iimhoffd7/25/2023
I want to use the vanilla tRPC client in NextJS (both browser+server), but I can't because it doesn't support the page context (ctx w/ req and res). tRPC Next seems to be built on top of React Query, which I don't want to use (it switches query() and mutate() to useQuery() and useMutate(), which can only be used in components). Am I missing something?

Looking for more? Join the community!

T
tRPC

How to use NextJS tRPC client without hooks?

Join Server