mirror of
https://github.com/supabase/supabase.git
synced 2026-05-09 02:09:50 -04:00
d07e78a616
This PR runs `prettier` on the `examples` folder. Depends on https://github.com/supabase/supabase/pull/43849.
21 lines
624 B
TypeScript
21 lines
624 B
TypeScript
'use client'
|
|
|
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
import { useState } from 'react'
|
|
|
|
export const ReactQueryClientProvider = ({ children }: { children: React.ReactNode }) => {
|
|
const [queryClient] = useState(
|
|
() =>
|
|
new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
// With SSR, we usually want to set some default staleTime
|
|
// above 0 to avoid refetching immediately on the client
|
|
staleTime: 60 * 1000,
|
|
},
|
|
},
|
|
})
|
|
)
|
|
return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
|
|
}
|