eexiv/src/app/providers.tsx

26 lines
538 B
TypeScript
Raw Normal View History

2024-02-12 19:42:56 -08:00
'use client'
import { useMemo } from 'react'
2024-02-12 19:42:56 -08:00
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
type ProvidersProps = {
children: React.ReactNode
}
export default function Providers({ children }: Readonly<ProvidersProps>) {
2024-02-17 14:56:26 -08:00
const queryClient = useMemo(
() =>
2024-02-12 19:42:56 -08:00
new QueryClient({
defaultOptions: {
queries: {
staleTime: 60 * 1000,
},
},
2024-02-17 14:56:26 -08:00
}),
[]
)
2024-02-12 19:42:56 -08:00
return (
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
)
}