Rendering different component in a shared layout based on page. #63341
Replies: 1 comment 1 reply
-
this discussion is marked as resolved with no solution provided. I'm having effectively this same issue in my application, where I want to place a page title (per-page data) in the same header component as an account selector (layout). as far as I'm aware this isn't possible in next.js' app router without including the header in the page rather than the layout. @nickythorne did you find a solution to this problem? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to utilise the features of nested layouts into order to have a shared header for child routes. However, I would like a way to inject custom components into that shared layout from the child pages without having to create a separate layout (if possible).
The anatomy of my page structure is as follows:
Is there anyway I can inject custom components from the page component (green) into the shared project layout (red) without having to define a new layout at the page level? The layout is mostly shared between the child routes, but I would like to get the benefits of having the shared layout at project level, but have the ability to inject custom component into that layout for the purposes of say, breadcrumbs - without having to define a new layout every time for the nested pages.
For example, another child layout would be a project settings, but I would like to use the same shared layout, but only change the breadcrumbs.
Beta Was this translation helpful? Give feedback.
All reactions