Can you get the queryClient without using a hook?

PBPieter Berkel4/21/2023
Can you get the queryClient without using a hook?
Nnlucas4/21/2023
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
PBPieter Berkel4/21/2023
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?
Nnlucas4/21/2023
You will need the hook then
Nnlucas4/21/2023
RQ has useQueryClient I believe
Nnlucas4/21/2023
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