The useQueryClient
hook returns the current QueryClient
instance.
import { useQueryClient } from '@tanstack/react-query'
const queryClient = useQueryClient({ context })
Options
context?: React.Context<QueryClient | undefined>
defaultContext
will be used.“This course is the best way to learn how to use React Query in real-world applications.”—Tanner LinsleyCheck it out