PieterP
tRPC3y ago
2 replies
Pieter

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

In the documentation you can use the vanilla TRPC client like this:

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?
Was this page helpful?