riprsa
riprsa6mo ago

Cannot figure out the correct type

I am trying to use tRPC outside of React. I use it in React, but I need a separate way to use it. I found out about trpc.useUtils().client, which is perfect. But I want to make it a global object for CSR components. I cannot figure out the right type to include in to the declaration. Thank you
Solution:
export const api = createTRPCClient<AppRouter>({ ... })
Jump to solution
2 Replies
riprsa
riprsaOP6mo ago
hm, i got a horrible error when i tried to use it, so may be i need a different approach
Solution
riprsa
riprsa6mo ago
export const api = createTRPCClient<AppRouter>({ ... })