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

@@ -2,21 +2,32 @@ import type { Metadata } from "next";
import "./globals.css";
import Providers from "./providers";
import { Suspense } from "react";
import { getQueryClient } from "./providersQueryClientUtils";
import { hydrateCourses } from "@/hooks/hookHydration";
import { dehydrate, HydrationBoundary } from "@tanstack/react-query";
export const metadata: Metadata = {
title: "Canvas Manager 2.0",
};
export default function RootLayout({
export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const queryClient = getQueryClient();
await hydrateCourses(queryClient);
const dehydratedState = dehydrate(queryClient);
return (
<html lang="en">
<body className="bg-slate-900 h-screen p-1 text-slate-300">
<Suspense>
<Providers>{children}</Providers>
<Providers>
<HydrationBoundary state={dehydratedState}>
{children}
</HydrationBoundary>
</Providers>
</Suspense>
</body>
</html>