How to handle multiple react-query `Providers`?
Working on a codebase that uses TRPC and a library called WAGMI that uses react-query. Since both TRPC and WAGMI provide their own
QueryClientProviders
I'm trying to figure out what the right way is to go about managing both of them6 Replies
WAGMI provides their own custom context and ensures that all of their respective
useQuery
and useMutation
use that contextUnknown User•2y ago
Message Not Public
Sign In & Join Server To View
I've tried doing that, while TRPC does support passing in a custom
QueryClient
, when I try to pass in a custom QueryClient
into WAGMI, I get an error that says that the queryCache types are not the sameI did a bit more reading as well and came upon this thread on github that talks about explicitly having different contexts between packages
https://github.com/TanStack/query/issues/4681
GitHub
remove contextSharing · Issue #4681 · TanStack/query
context The QueryClientProvider has a prop contextSharing: boolean. The docs say: Set this to true to enable context sharing, which will share the first and at least one instance of the context acr...
Which leads me to think that maybe separating out the contexts may be more beneficial
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View