0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
query/docs/framework/preact/reference/functions/QueryClientProvider.md
Wonsuk Choi 84b4f13470
docs(preact-query): document type parameters with '@template' and add 'useQueryClient' throws note (#11285)
* docs(preact-query): document type parameters with '@template' and add 'useQueryClient' throws note

* docs(preact-query): fix TQueryData select direction and TResults/TDepth phrasing flagged by CodeRabbit
2026-08-25 21:28:15 +09:00

1.1 KiB

id title
QueryClientProvider QueryClientProvider
function QueryClientProvider(__namedParameters): VNode;

Defined in: preact-query/src/QueryClientProvider.tsx:70

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

__namedParameters

QueryClientProviderProps

Returns

VNode

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

Example

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

const queryClient = new QueryClient()

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