Replies: 1 comment
-
I'm struggling with this as well, i just want to replace a deeply nested routes layout without completely dismantling my folder structure and duplicating layouts for every other sub-tree. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Background
Next.js app directory sometimes make the structure of project deeply nested and each child need own
layout
file.But because of sharing layouts between parent and children, sometimes it's make serious conflicts between them.
Also, because of having correct hierarchy route, it's not meaningful to change the structure of the project.
👉 I know there are some solutions like conditional rendering in parent layouts based on path of route to extract parent layout and resolve conflict between them, but I think there should be better solution for this. Because sometimes extracting more than one route from parent layout make the code so dirty.
Proposal
I think setting a specific variable for nested layout to make it isolated from parent layouts be a good solution.
Beta Was this translation helpful? Give feedback.
All reactions