overiding root layout
Unanswered
astro posted this in #help-forum
astroOP
i want to have separate layout for my home page and dashboard page, but the homepage's layout seems to mix with dashboard page
dashboard/layout.tsx
dashboard/layout.tsx
import React from "react";
export default function DashboardLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<div>
<h1>THis is nav</h1>
{children}
<h1>THis is footer</h1>
</div>
);
}2 Replies
astroOP
Arboreal ant
If you use route groups it's easy:
https://nextjs.org/docs/app/building-your-application/routing/route-groups
https://nextjs.org/docs/app/building-your-application/routing/route-groups