How to not show header on certain pages for an app?
Answered
American Kestrel posted this in #help-forum
American KestrelOP
In my layout.tsx, I dont want to show
<Header /> on certain pages, how can I do that? I cant use useRouter as its for the client side and I cant turn layout.tsx into client side through use client, cuz it holds everything in the app. Whats the appropriate way to do this?Answered by riský
use route groups and put the header one one of them and the other one don't...
9 Replies
use route groups and put the header one one of them and the other one don't...
Answer
American KestrelOP
is there no other way
;-;
that's a lot fo work
It's really simple... Just create a folder with (name) and then a layout file... https://nextjs.org/docs/app/building-your-application/routing/route-groups
@American Kestrel did it work?
American KestrelOP
YEAH!
omg thanks so much
American KestrelOP
Thank you:))