How to access trpcClient like in react-query: queryClient.fetchQuery ?
In react-query, the queryClient is exported and I can use it in certain situations like so
const posts = await queryClient.fetchQuery( ...
but with tRPC boilerplate code, I don't have access to the client and I can't emulate the behavior above.
Btw I am not using Next.JS, i am using normal react frontend .
Here is my boilerplate (feel free to give suggestions):
TrpcProvider.tsx
Index.ts
1 Reply
import { trpc } from "@/utils/trpc";
const utils = trpc.useContext()