Next.js 13 app directory share header in all pages
Answered
Saltwater Crocodile posted this in #help-forum
Saltwater CrocodileOP
In my application I have three pages.
1) Home page.
2)Contact page
3)Login page
as you can see in the screenshot.
And I have a header component. I want to show the header component on all the pages except the login page. I don't want to show the header component on the login page. how can I overcome the problem without leaving the Layout component? As I already shared in the screenshot
1) Home page.
2)Contact page
3)Login page
as you can see in the screenshot.
And I have a header component. I want to show the header component on all the pages except the login page. I don't want to show the header component on the login page. how can I overcome the problem without leaving the Layout component? As I already shared in the screenshot
19 Replies
have you considered route groups?
Answer
Saltwater CrocodileOP
Nope. can you explain about route groups
Read the docs
@Saltwater Crocodile Nope. can you explain about route groups
have you looked at the docs for route groups yet?
Saltwater CrocodileOP
Sorry I don't why but somehow i can't access the nextjs.org website. I think my network problem. My bad , I will keep in touch
@riský have you looked at the docs for route groups yet?
Saltwater CrocodileOP
Thanks for your kind reply
so, did your doubt got resolved @Saltwater Crocodile ?
he apparently can't use the website, so im waiting for that to continue helping
@dumbboy so, did your doubt got resolved <@876124709765382145> ?
Saltwater CrocodileOP
first i need check the next.js docs then I need to try again.Thanks guys for your valuable time
@dumbboy Is it still not opening?
Saltwater CrocodileOP
no. I need to call my ISP
oh, okay, all the best
Saltwater CrocodileOP
I just needed a little hint. At least it worked
yay!!!
@riský yay!!!
Saltwater CrocodileOP
Thanks everyone for the help
English Spot
Hey @Saltwater Crocodile How did you do it?
@English Spot Hey <@876124709765382145> How did you do it?
Saltwater CrocodileOP
It was to easy to do. Just read the docs about next.js route groups. You will be able to find out yourself
English Spot
route groups for customising the routing right? but I have another query that did you place your Header component in Root layout?