The useQueryClient hook returns the current QueryClient instance.
import { useQueryClient } from '@tanstack/react-query'
const queryClient = useQueryClient(queryClient?: QueryClient)
import { useQueryClient } from '@tanstack/react-query'
const queryClient = useQueryClient(queryClient?: QueryClient)
Options
“This course is the best way to learn how to use React Query in real-world applications.”—Tanner LinsleyGet the course
“This course is the best way to learn how to use React Query in real-world applications.”—Tanner LinsleyGet the course