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

useQueryClient.md

17 lines395 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({ context })
12```
13​
14**Options**
15​
16- `context?: React.Context<QueryClient | undefined>`
17 - Use this to use a custom React Query context. Otherwise, `defaultContext` will be used.