import { type LoaderFunction, json } from "@remix-run/node"; import { Outlet, useCatch, useMatches } from "@remix-run/react"; import { type SessionData, requireLoggedIn } from "~/utils/auth.server"; import Footer from "~/features/core/components/footer"; export type AppLoaderData = SessionData; export const loader: LoaderFunction = async ({ request }) => { const sessionData = await requireLoggedIn(request); return json(sessionData); }; export default function __App() { const matches = useMatches(); const hideFooter = matches.some((match) => match.handle?.hideFooter === true); return (
{!hideFooter ?
: null}
); } export function CatchBoundary() { const caught = useCatch(); console.log("caught", caught); return (
{caught.status}
); }