mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-27 07:58:31 -06:00
trying to get nextjs fast
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user