dify/web/context/query-client.tsx
2024-11-07 15:24:17 +08:00

16 lines
479 B
TypeScript

'use client'
import type { FC, PropsWithChildren } from 'react'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
const client = new QueryClient()
export const TanstackQueryIniter: FC<PropsWithChildren> = (props) => {
const { children } = props
return <QueryClientProvider client={client}>
{children}
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
}