79538909

Date: 2025-03-27 12:55:07
Score: 1.5
Natty:
Report link

As the example in documentation (https://tanstack.com/query/latest/docs/framework/react/reference/QueryClientProvider#queryclientprovider), you have to instantiate your queryClient outside of your app component.

This solved the problem for me.

import { QueryClient, QueryClientProvider } from '@tanstack/react-query'

const queryClient = new QueryClient()

function App() {
  return <QueryClientProvider client={queryClient}>...</QueryClientProvider>
}

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: mguzman