QueryClientProvider

Before starting using Auth React providers, you need to importQueryClientProvider . The provider is supplied from TanStack Query, added during the Auth React installation, to enable fetching, caching, synchronizing, and updating asynchronous data in your React application.

You also need to import QueryClient from your Config.ts file and Auth it as a property of QueryClientProvider.

QueryClientProvider must be above the providers that Auth React supplies.

Example:

import { QueryClientProvider } from '@tanstack/react-query';
import { queryClient } from './config';
...

export default function Providers({ children }: { children: React.ReactNode }) {
  return (
    <QueryClientProvider client={queryClient}>
	/* Auth React providers go here */
    </QueryClientProvider>
  );
}

Check TanStack Query Docs for more information on QueryClient and QueryClientProvider.

Last updated

© 2023 -> ♾️