mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 23:58:31 -06:00
trying to get page to load without error
This commit is contained in:
21
nextjs/src/app/course/[courseName]/layout.tsx
Normal file
21
nextjs/src/app/course/[courseName]/layout.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user