0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
query/docs/framework/react/reference/useQueryClient.md
Lachlan Collins 0cdbd5a198
docs: Re-organise for new docs layout (#6763)
* docs: Re-organise for v2 docs layout

* Add $schema
2024-01-26 07:57:22 +11:00

395 B

id title
useQueryClient useQueryClient

The useQueryClient hook returns the current QueryClient instance.

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.