Open History to see the last commit
1---
2id: QueryClientProvider
3title: QueryClientProvider
4---
5β
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7β
8```ts
9function QueryClientProvider(props: QueryClientProviderProps): Element;
10```
11β
12Defined in: [packages/solid-query/src/QueryClientProvider.tsx:231](https://github.com/TanStack/query/blob/main/packages/solid-query/src/QueryClientProvider.tsx#L231)
13β
14Provides the QueryClient and manages its mount lifecycle. On the server
15it also registers the cache serializer above; on the client, hooks prime
16the cache from their hash-keyed registry entries themselves (see
17`useBaseQuery`) and the provider subscribes the cache's single-flight
18consumer: mutation responses carrying a `FLIGHT_DATA_SOURCE` slice (a
19`DehydratedState` produced by a server collector registered under the
20same id) hydrate this client before the mutation's promise resolves.
21Subscribing is inert when no server collector exists β the server just
22folds nothing β so it is unconditional. One consumer per source: with
23nested providers, the innermost mounted one owns the slice.
24β
25## Parameters
26β
27### props
28β
29[`QueryClientProviderProps`](../type-aliases/QueryClientProviderProps.md)
30β
31The `client` to provide, and the `children` that get access to it.
32β
33<a id="props-properties"></a>
34β
35#### `props` properties
36β
37| Property | Type | Description |
38| ------ | ------ | ------ |
39| <a id="props-property-children"></a> `children?` | `JSX.Element` | The components that get access to the provided `QueryClient`. |
40| <a id="props-property-client"></a> `client` | [`QueryClient`](../classes/QueryClient.md) | **Required** The `QueryClient` instance to provide. |
41β
42## Returns
43β
44`Element`
45β
46The provided `children`, wrapped so they can read the `QueryClient` via `useQueryClient`.