mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
trying to get page to load without error
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
"use client"
|
||||
import {
|
||||
DehydratedState,
|
||||
hydrate,
|
||||
QueryClientProvider,
|
||||
} from "@tanstack/react-query";
|
||||
import React from "react";
|
||||
import { ReactNode, useState } from "react";
|
||||
import { createQueryClient } from "./queryClient";
|
||||
|
||||
export default function MyQueryClientProvider({
|
||||
children,
|
||||
dehydratedState,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
dehydratedState: DehydratedState;
|
||||
}) {
|
||||
const [queryClient] = useState(createQueryClient());
|
||||
|
||||
hydrate(queryClient, dehydratedState);
|
||||
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
|
||||
);
|
||||
}
|
||||
@@ -123,23 +123,23 @@ export function createSuccessToast(message: string) {
|
||||
);
|
||||
}
|
||||
|
||||
export function createQueryClient() {
|
||||
return new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
refetchOnWindowFocus: false,
|
||||
retry: 0,
|
||||
},
|
||||
mutations: {
|
||||
onError: addErrorAsToast,
|
||||
retry: 0,
|
||||
},
|
||||
},
|
||||
queryCache: new QueryCache({
|
||||
onError: addErrorAsToast,
|
||||
}),
|
||||
mutationCache: new MutationCache({
|
||||
onError: addErrorAsToast,
|
||||
}),
|
||||
});
|
||||
}
|
||||
// export function createQueryClient() {
|
||||
// return new QueryClient({
|
||||
// defaultOptions: {
|
||||
// queries: {
|
||||
// refetchOnWindowFocus: false,
|
||||
// retry: 0,
|
||||
// },
|
||||
// mutations: {
|
||||
// onError: addErrorAsToast,
|
||||
// retry: 0,
|
||||
// },
|
||||
// },
|
||||
// queryCache: new QueryCache({
|
||||
// onError: addErrorAsToast,
|
||||
// }),
|
||||
// mutationCache: new MutationCache({
|
||||
// onError: addErrorAsToast,
|
||||
// }),
|
||||
// });
|
||||
// }
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import { MutationCache, QueryCache, QueryClient } from "@tanstack/react-query";
|
||||
|
||||
export function createQueryClientForServer() {
|
||||
return new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
refetchOnWindowFocus: false,
|
||||
retry: 0,
|
||||
},
|
||||
mutations: {
|
||||
onError: (e) => console.log(e),
|
||||
retry: 0,
|
||||
},
|
||||
},
|
||||
queryCache: new QueryCache({
|
||||
onError: (e) => console.log(e),
|
||||
}),
|
||||
mutationCache: new MutationCache({
|
||||
onError: (e) => console.log(e),
|
||||
}),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user