tasko/components/providers/query-provider.tsx

13 lines
362 B
TypeScript
Raw Normal View History

2024-02-16 01:49:19 +00:00
'use client';
2024-02-15 02:30:10 +00:00
2024-02-16 01:49:19 +00:00
import { useState } from 'react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
2024-02-15 02:30:10 +00:00
2024-02-16 01:49:19 +00:00
export const QueryProvider = ({ children }: { children: React.ReactNode }) => {
2024-02-15 02:30:10 +00:00
const [queryClient] = useState(() => new QueryClient());
return (
2024-02-16 01:49:19 +00:00
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
);
};