0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-18 19:33:22 +00:00
query/docs/framework/react/reference/functions/QueryClientProvider.md
Wonsuk Choi ba341f5a07
docs(react-query): add missing JSDoc to react-query, react-query-next-experimental, and react-query-devtools (#11843)
* docs(react-query): add missing JSDoc to react-query, react-query-next-experimental, and react-query-devtools

* docs(react-query-next-experimental): correct where streamed hydration and HTML insertion happen
2026-10-04 04:15:50 +09:00

1.2 KiB

id title redirect_from
QueryClientProvider QueryClientProvider
framework/react/reference/QueryClientProvider
function QueryClientProvider(props: QueryClientProviderProps): Element;

Defined in: packages/react-query/src/QueryClientProvider.tsx:69

Use the QueryClientProvider component to connect and provide a QueryClient to your application. Also calls client.mount()/client.unmount() as this component mounts/unmounts, which subscribes the client to focus/online events (resuming any paused mutations and refetching as needed when the app regains focus or comes back online).

Parameters

props

QueryClientProviderProps

The client to provide, and the children that get access to it.

Returns

Element

The provided children, wrapped so they can read the QueryClient via useQueryClient.

Example

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

const queryClient = new QueryClient()

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