From 78157a87d57ab4dea4ca2719bd235ddfc926500c Mon Sep 17 00:00:00 2001 From: Donkoko Date: Fri, 16 Aug 2024 13:37:12 +0300 Subject: [PATCH] fix: updating layout export in root --- app/root.tsx | 13 +++++-------- app/routes/qr+/route.tsx | 3 +++ 2 files changed, 8 insertions(+), 8 deletions(-) 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 }>) {