Solve the error: Type ‘{ children: Element[]; client: QueryClient; }’ is not assignable to type ‘IntrinsicAttributes & QueryClientProviderProps’.
Property ‘children’ does not exist on type ‘IntrinsicAttributes & QueryClientProviderProps’

React QueryClient error after upgrading React to v18

React Query v3 is not meant to be used with react v18. Concurrent features can’t work properly without useSyncExternalStore, which is been used in React Query v4 beta.

Don’t freak out when you see more libraries break because React has changed how Functional Components are defined and it has affected a lot of libraries.

Solution One

The recommended fix for this error is to upgrade React Query v3 to React Query to v4 beta

Solution Two

To solve this error you can downgrade from @types/reactv18 and @types/react-dom v18 to @types/react v17 and @types/react-dom v17.

Also read: