Capítulo 72 de 80
Connects a QueryClient instance to the React tree via context — every useQuery/useMutation/etc. below it resolves to this client unless explicitly overridden with a per-call queryClient argument.
client: QueryClient.const queryClient = new QueryClient()
function App() {
return <QueryClientProvider client={queryClient}>...</QueryClientProvider>
}
QueryClientProvider by default — the explicit queryClient argument on hooks/QueryClient methods is only for the rarer multi-client case.