The useQueryClient hook returns the current QueryClient instance.
import { useQueryClient } from 'react-query' const queryClient = useQueryClient()