Open History to see the last commit
1---
2id: QueryClientProvider
3title: QueryClientProvider
4---
5β
6```ts
7function QueryClientProvider(props: QueryClientProviderProps): Element;
8```
9β
10Defined in: [packages/solid-query/src/QueryClientProvider.tsx:100](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClientProvider.tsx#L100)
11β
12Use the `QueryClientProvider` component to connect and provide a `QueryClient` to your application. Also
13calls `client.mount()`/`client.unmount()` as this component mounts/unmounts, which subscribes the client to
14focus/online events (resuming any paused mutations and refetching as needed when the app regains focus or
15comes back online).
16β
17## Parameters
18β
19### props
20β
21[`QueryClientProviderProps`](../type-aliases/QueryClientProviderProps.md)
22β
23The `client` to provide, and the `children` that get access to it.
24β
25<a id="props-properties"></a>
26β
27#### `props` properties
28β
29| Property | Type | Description |
30| ------ | ------ | ------ |
31| <a id="props-property-children"></a> `children?` | `JSX.Element` | The components that get access to the provided `QueryClient`. |
32| <a id="props-property-client"></a> `client` | [`QueryClient`](../classes/QueryClient.md) | **Required** The `QueryClient` instance to provide. |
33β
34## Returns
35β
36`Element`
37β
38The provided `children`, wrapped so they can read the `QueryClient` via `useQueryClient`.
39β
40## Example
41β
42```tsx
43import { QueryClient, QueryClientProvider } from '@tanstack/solid-query'
44β
45const queryClient = new QueryClient()
46β
47function App() {
48 return <QueryClientProvider client={queryClient}>...</QueryClientProvider>
49}
50```