complete installation page - create reusable table - install and config react query

This commit is contained in:
Alihaghighattalab
2024-08-10 17:48:08 +03:30
parent c5e67d85ca
commit bfd9fa2b64
16 changed files with 1017 additions and 3 deletions
+23
View File
@@ -0,0 +1,23 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
import { ReactQueryDevtools } from "@tanstack/react-query-devtools"
import { PropsWithChildren, useRef } from "react"
export const RQProvider = ({ children }: PropsWithChildren) => {
const rqConfig = useRef(
new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
retry: 0,
staleTime: 15 * 1000
}
}
})
)
return (
<QueryClientProvider client={rqConfig.current}>
{children}
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
)
}