I'm stuck on layouts (beginner)
Unanswered
Rufous-capped Warbler posted this in #help-forum
Rufous-capped WarblerOP
Hey, can I pull a project with only one layout.js?
I really have a children page, which is one to be changed at a time.
So, basically I have Navbar and Footer always, based on Links/url, only one page will change, more like a static website (it should be an app, but I'm on start of building).
how to set up layout.js effectively?
I really have a children page, which is one to be changed at a time.
So, basically I have Navbar and Footer always, based on Links/url, only one page will change, more like a static website (it should be an app, but I'm on start of building).
how to set up layout.js effectively?
6 Replies
Use the layout to „layout“ stuff. So build the specific components. In your case „navbar“ and „footer“. And inside your layout you create for example your grid or your flex boxes or whatever to layout your page @Rufous-capped Warbler
@Rufous-capped Warbler solved?
@Rufous-capped Warbler ?
Rufous-capped WarblerOP
yes 😄 sorry, life has gotten into the way... I've read about layouts in official documentation
I've been also behind the last Next.js update, was mixing the Pages and App routing... now I'm fully on "App" way. Done with root layout, and then, as I assume - other layouts are nested by default in {children} props. Or perhaps wrapped in the root layout without props? Not sure... however - I need only the Root layout to define HTML tags and place navbar and footer - as you said 🙂
I will mark the post as solved by placing a "check" arrow on my post