0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
query/docs/framework/react/reference/functions/useQueryClient.md
Wonsuk Choi f38e6271b4
chore(*): update '@tanstack/typedoc-config' to v0.3.5 (#12035)
* chore(scripts/generate-docs): read type alias bodies whose type parameters have defaults

* chore(*): update '@tanstack/typedoc-config' to v0.3.5
2026-10-17 11:14:03 +09:00

875 B

id title redirect_from
useQueryClient useQueryClient
framework/react/reference/useQueryClient
function useQueryClient(queryClient?: QueryClient): QueryClient;

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

The useQueryClient hook returns the current QueryClient instance.

Parameters

queryClient?

QueryClient

Use this to use a custom QueryClient. Otherwise, the one from the nearest context will be used.

Returns

QueryClient

The current QueryClient instance.

Throws

If no queryClient argument is passed and no QueryClientProvider is found in the component tree.