next.js
13dad0dd - docs: clarify layout.js nesting behavior in route groups (#95720)

Commit
34 days ago
docs: clarify layout.js nesting behavior in route groups (#95720) ### What? - Adds one clarifying sentence (plus a link) to the "Organize routes without affecting the URL path" section in docs/01-app/01-getting-started/02-project-structure.mdx. No behavior change, docs text only. --- ### Why? - The existing sentence says you can add a layout.js inside a route group folder to give it a different layout, but it doesn't say whether that layout.js nests inside the top-level app/layout.js or replaces it. Read in order, a reader hits this line before the page ever mentions removing the top-level layout, so it's genuinely ambiguous at that point in the page. The nesting behavior is only clarified later, in the "Creating multiple root layouts" section — and even then, it's explained for a different, more specific case (removing the top-level layout entirely to give each route group its own root layout). --- ### How? - Added one sentence stating that this layout.js nests inside the top-level app/layout.js like any other layout by default, and linked to "Creating multiple root layouts" for readers who want the root-layout behavior instead. --------- Co-authored-by: Joseph <sephxd1234@gmail.com>
Author
Parents
Loading