Docs
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
AI/LLM: This documentation page is available in plain markdown format at/query/v4/docs/framework/react/reference/useQueryClient.md
API Reference

useQueryClient

The useQueryClient hook returns the current QueryClient instance.

tsx
import { useQueryClient } from '@tanstack/react-query'

const queryClient = useQueryClient({ context })

Options

  • context?: React.Context<QueryClient | undefined>
    • Use this to use a custom React Query context. Otherwise, defaultContext will be used.