I have folder structure as follows:
app
|_layout.tsx
|_feature1
|_page.tsx
|_layout.tsx
|_feature2
|_page.tsx
... (other pages and folder that use main layout as-is)
app/layout:
<HTML><body>
<header>Root Header</header>
<body> {children} </body>
</body></html>
feature1/layout:
<header>Instead of Root, I should display</header>
{children}
Current output:
root header
Instead of Root, I should display
Question1: How can I override the header in feature1 layout to a different layout?
Question2: How can I hide header in feature 2?
Options, I thought of:
- A way that parent layout can read child layout overrides (like
showHeader=false
ORheader = <replacementheader/>
) - Some declarative way in child layouts that override parent layout (I did it once long back but fot how I did