trying to get page to load without error

This commit is contained in:
2024-08-30 14:20:31 -06:00
parent baa69348a3
commit 13be104499
16 changed files with 188 additions and 129 deletions

View File

@@ -0,0 +1,21 @@
import { dehydrate, HydrationBoundary, QueryClient } from "@tanstack/react-query";
import { hydrateCourse } from "@/hooks/hookHydration";
import { getQueryClient } from "@/app/providersQueryClientUtils";
export default async function CourseLayout({
children,
params: { courseName },
}: {
children: React.ReactNode;
params: { courseName: string };
}) {
const queryClient = getQueryClient();
await hydrateCourse(queryClient, courseName);
const dehydratedState = dehydrate(queryClient);
console.log("hydrated course state", courseName, dehydratedState);
return (
<HydrationBoundary state={dehydratedState}>{children}</HydrationBoundary>
);
}