Nacho EliasN
tRPC4y ago
70 replies
Nacho Elias

useQueryClient is not working as expected

So before v10 I was simply using useQueryClient and had my queryClient strongly typed. Now I moved to v10 and for some reason, the documentation says that the queryClient was removed from the context so I should use the useQueryClient hook directly from @tanstack but if I do so then the queryClient returned by that hook is not the queryClient trpc is using, it's just empty. I made it work by using the trpc.useContext hook coming from my client utils but I definitely think that the docs are a bit f*cked up.
Was this page helpful?