---
|
|||
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**
|
|||
|
|||
|
docs: remove unnecessary trailing comma (#9594)
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
|
- `queryClient?: QueryClient`
|
||
- Use this to use a custom QueryClient. Otherwise, the one from the nearest context will be used.
|