diff --git a/app/root.tsx b/app/root.tsx index 1f61e7da7..416168620 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -1,4 +1,3 @@ -import type { PropsWithChildren } from "react"; import type { User } from "@prisma/client"; import type { LinksFunction, @@ -14,6 +13,7 @@ import { Scripts, ScrollRestoration, useLoaderData, + useRouteLoaderData, } from "@remix-run/react"; import { withSentry } from "@sentry/remix"; import nProgressStyles from "nprogress/nprogress.css?url"; @@ -77,8 +77,8 @@ export const loader = ({ request }: LoaderFunctionArgs) => export const shouldRevalidate = () => false; -function Document({ children, title }: PropsWithChildren<{ title?: string }>) { - const { env } = useLoaderData(); +export function Layout({ children }: { children: React.ReactNode }) { + const data = useRouteLoaderData("root"); const nonce = useNonce(); return ( @@ -88,7 +88,6 @@ function Document({ children, title }: PropsWithChildren<{ title?: string }>) {