Replies: 2 comments
-
Layouts can wrap other layouts, as their are nested in your file directory:
What you need is a route group, to opt out from the root layout. https://nextjs.org/docs/app/building-your-application/routing/route-groups. See this part:
|
Beta Was this translation helpful? Give feedback.
-
Another Question to this topic:I structured my app now like following: (APP)/ (AUTH)/ Like this, I can freely design layouts for both root layouts. But my not-found.tsx files are not working. (Template from Vercel is shown) Anyone knows why? When I define them in my /app root again, the layout file will overwrite the (APP) and (AUTH) file. Hope someone has an idea how I can keep this structure and still define my own style for not-found.tsx. |
Beta Was this translation helpful? Give feedback.
-
Summary
Hi all!
Probably a simple question, but I am stuck here. In my next.js project, I created a root layout.tsx file:
Works for all pages fine. But now, for my login/page.tsx, I want to create a different layout (without the Navbar and Footer). As I understand the documentation, when creating a login/layout.tsx file, it should overwrite the root layout? But it does not, still having a Navbar in in my login/page.tsx.
login/layout.tsx:
Anyone an idea? Not really want to delete the Navbar of my route/layout.tsx and define for every path an extra layout.tsx file.
Cheers for any help!!
Tobi
Beta Was this translation helpful? Give feedback.
All reactions