mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
25 lines
801 B
TypeScript
25 lines
801 B
TypeScript
"use client";
|
|
import {
|
|
QueryClientProvider,
|
|
} from "@tanstack/react-query";
|
|
import { ReactNode } from "react";
|
|
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|
import { getQueryClient } from "./providersQueryClientUtils";
|
|
|
|
|
|
export default function Providers({ children }: { children: ReactNode }) {
|
|
// NOTE: Avoid useState when initializing the query client if you don't
|
|
// have a suspense boundary between this and the code that may
|
|
// suspend because React will throw away the client on the initial
|
|
// render if it suspends and there is no boundary
|
|
|
|
const queryClient = getQueryClient();
|
|
|
|
return (
|
|
<QueryClientProvider client={queryClient}>
|
|
<ReactQueryDevtools initialIsOpen={false} />
|
|
{children}
|
|
</QueryClientProvider>
|
|
);
|
|
}
|