T
TanStack16mo ago
adverse-sapphire

QueryClientProvider v5 context

Hey I'm reading the migrating to v5 docs: https://tanstack.com/query/latest/docs/framework/react/guides/migrating-to-v5 Under the header "The contextSharing prop has been removed from QueryClientProvider" https://tanstack.com/query/latest/docs/framework/react/guides/migrating-to-v5#the-contextsharing-prop-has-been-removed-from-queryclientprovider It recommends using the context property for sharing the query client across packages/apps: If you wish to use the same query client across multiple packages of an application, you can create a QueryClient in your application and then let the bundles share this through the context property of the QueryClientProvider. context was removed from the QueryClientProvider in v5 as well though? No context on latest v5+: https://tanstack.com/query/latest/docs/framework/react/reference/QueryClientProvider#queryclientprovider context on v4: https://tanstack.com/query/v4/docs/framework/react/reference/QueryClientProvider
Migrating to TanStack Query v5 | TanStack Query React Docs
Breaking Changes v5 is a major version, so there are some breaking changes to be aware of:
QueryClientProvider | TanStack Query React Docs
Use the QueryClientProvider component to connect and provide a QueryClient to your application: `tsx
QueryClientProvider | TanStack Query React Docs
Use the QueryClientProvider component to connect and provide a QueryClient to your application: `tsx
3 Replies
adverse-sapphire
adverse-sapphire16mo ago
Migrating to TanStack Query v5 | TanStack Query React Docs
Breaking Changes v5 is a major version, so there are some breaking changes to be aware of:
adverse-sapphire
adverse-sapphire16mo ago
I think we wrote the contextSharing removal first so the migration docs are not up-to-date. Please file a PR if you can 🙏

Did you find this page helpful?