trying to get nextjs fast

This commit is contained in:
2024-09-09 12:15:31 -06:00
parent 88fd59606b
commit ef2e6da760
6 changed files with 30 additions and 30 deletions

View File

@@ -1,6 +1,3 @@
import { dehydrate, HydrationBoundary } from "@tanstack/react-query";
import { getQueryClient } from "@/app/providersQueryClientUtils";
import { hydrateCourse } from "@/hooks/hookHydration";
import CourseContextProvider from "./context/CourseContextProvider";
import { Suspense } from "react";
@@ -16,18 +13,10 @@ export default async function CourseLayout({
console.log("cannot load course that is .js.map " + decodedCourseName);
return <div></div>;
}
const queryClient = getQueryClient();
await hydrateCourse(queryClient, decodedCourseName);
const dehydratedState = dehydrate(queryClient);
// console.log("hydrated course state", courseName, dehydratedState);
return (
<Suspense>
<CourseContextProvider localCourseName={decodedCourseName}>
<HydrationBoundary state={dehydratedState}>
{children}
</HydrationBoundary>
{children}
</CourseContextProvider>
</Suspense>
);