Eternal Mori
Eternal Mori2y ago

Can you get the queryClient without using a hook?

Can you get the queryClient without using a hook?
4 Replies
Nick
Nick2y ago
Yes if you don't need SSR, you create it during setup and it doesn't have to be created inside a component. It's just a variable you can export
Eternal Mori
Eternal Mori2y ago
I forgot to add that I am using it with NextJS, I have a withTRPC wrapper in my App. Is there a way to extract the queryClient from there?
Nick
Nick2y ago
You will need the hook then RQ has useQueryClient I believe If you’re not using SSR you can probably get away with replacing the withTRPC with something lower level, but if you want SSR then it’s the hook for the above reasons