🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.
---
id: useQueryClient
title: useQueryClient
The `useQueryClient` hook returns the current `QueryClient` instance.
```tsx
import { useQueryClient } from '@tanstack/react-query'
const queryClient = useQueryClient(queryClient?: QueryClient)
```
**Options**
- `queryClient?: QueryClient`,
- Use this to use a custom QueryClient. Otherwise, the one from the nearest context will be used.