0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
query/docs/framework/solid/reference/functions/useQueryClient.md

746 B

id title
useQueryClient useQueryClient
function useQueryClient(queryClient?: QueryClient): QueryClient;

Defined in: packages/solid-query/src/QueryClientProvider.tsx:28

The useQueryClient function 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.