T
tRPC

❓-help

How can I make a direct fetch on a router endpoint from TRPC in NextJS on client?

APA. Perkamentus4/21/2023
In the documentation you can use the vanilla TRPC client like this:
const bilbo = await client.getUser.query('id_bilbo');
const bilbo = await client.getUser.query('id_bilbo');
But with NextJS app is wrapped with the WithTRPC wrapper. where you can only use hooks. How can I make a direct call?

Looking for more? Join the community!