Skip to content
Source
Sign inSign up
fuko/trytanstackdb.com
Open History to see the last commit

root-provider.tsx

20 lines401 Bytes

1import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
2​
3export function getContext() {
4 const queryClient = new QueryClient();
5 return {
6 queryClient,
7 };
8}
9​
10export function Provider({
11 children,
12 queryClient,
13}: {
14 children: React.ReactNode;
15 queryClient: QueryClient;
16}) {
17 return (
18 <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
19 );