-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Description
Describe the bug
Hydration is broken. This can also be seen in the Next.js-example:
No QueryClient set, use QueryClientProvider to set one
The /hydration-package has at some point (v3 release?) switched from import { useQueryClient } from 'react-query' to import { useQueryClient } from '../react'. This bundles the useQueryClient code into the hydration package itself, which also means a separate QueryClientSharingContext gets created there. This is line 124 in dist/react-query-hydration.development.js:
var QueryClientSharingContext = /*#__PURE__*/React.createContext(false);
Because this context is different from the one QueryClientProvider uses, the hydration package can't find a queryClient to work with.
I plan to fix this but wanted to document the bug as soon as I found it.