Remove parrent layout on certain pages in Nextjs 15
Answered
Asian black bear posted this in #help-forum
Asian black bearOP
i wanna remove navbar and footer from chat page
Answered by chisto
you need 2 route groups
withNavbarAndFooter layout will have a layout with navbar and footer and all folders there that u want to have those
and the layout in withoutNavBarAndFooter wont have those
withNavbarAndFooter layout will have a layout with navbar and footer and all folders there that u want to have those
and the layout in withoutNavBarAndFooter wont have those
6 Replies
you have to make 2 route groups and separate layouts so they don't share footer and navbar
@chisto you have to make 2 route groups and separate layouts so they don't share footer and navbar
Asian black bearOP
I don't get it you mean like
app => {
chat => {
layout.tsx
page.tsx
[id]
}
page.tsx
layout.tsx
}
app => {
chat => {
layout.tsx
page.tsx
[id]
}
page.tsx
layout.tsx
}
you cant have the footer and navbar on the root layout because it will be shared with everything
you need 2 route groups
withNavbarAndFooter layout will have a layout with navbar and footer and all folders there that u want to have those
and the layout in withoutNavBarAndFooter wont have those
withNavbarAndFooter layout will have a layout with navbar and footer and all folders there that u want to have those
and the layout in withoutNavBarAndFooter wont have those
Answer
Asian black bearOP
thanks !