Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

useQueryClient.md

17 lines394 Bytes

1---
2id: useQueryClient
3title: useQueryClient
4---
5​
6The `useQueryClient` hook returns the current `QueryClient` instance.
7​
8```tsx
9import { useQueryClient } from '@tanstack/react-query'
10​
11const queryClient = useQueryClient(queryClient?: QueryClient)
12```
13​
14**Options**
15​
16- `queryClient?: QueryClient`
17 - Use this to use a custom QueryClient. Otherwise, the one from the nearest context will be used.