Next.js Discord

Discord Forum

Remove layout from lower pages

Answered
Giant ichneumon wasp posted this in #help-forum
Open in Discord
Giant ichneumon waspOP
So I have:
app
|- login
|- register

I want app (/) and the rest of the application to show their nested layouts but not login or register, how can I opt them out of the upper layout? Or how can one bypass this situation? I thought about creating a lower page and intercepting that route in the root page

7 Replies

Answer
Giant ichneumon waspOP
@European sprat I've read that, yet I can't see how it helps me
European sprat
- app
- - (everything except login/logout)
- - - layout.tsx
- - - page.tsx
- - (login/logout)
- - - login/
- - - logout/
- - - layout.tsx

does something like that work?
European sprat
oh yeah there's an example for multiple root layouts there, forgot about that
Giant ichneumon waspOP
yeah that helped thanks @European sprat @not-milo.tsx