Skip to content

Comments

Inherit layout recursively on routes#1884

Open
dan-lee wants to merge 1 commit intomainfrom
fix/recursive-layout-handling
Open

Inherit layout recursively on routes#1884
dan-lee wants to merge 1 commit intomainfrom
fix/recursive-layout-handling

Conversation

@dan-lee
Copy link
Contributor

@dan-lee dan-lee commented Jan 20, 2026

Allows recursive layout handling for routes, so they can be defined like:

getRoutes: () => [
  {
    element: <Provider><Outlet /></Provider>,
    handle: { layout: "none" },
    children: [{
      // 👇 Will inherit layout: "none" 
      path: "/custom",
      element: <Page />,
    }]
  }
]

@dan-lee dan-lee requested review from Copilot and mosch January 20, 2026 13:36
@dan-lee dan-lee added the bug label Jan 20, 2026
@vercel
Copy link

vercel bot commented Jan 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
zudoku-cosmo-cargo Ready Ready Preview Jan 20, 2026 2:45pm
zudoku-dev Ready Ready Preview Jan 20, 2026 2:45pm

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the route layout handling to work recursively on nested routes. Previously, the layout wrapper was only applied to top-level routes. Now, the new processRoutes function recursively processes all route children and applies layout wrapping at each level.

Changes:

  • Replaced the wrapWithLayout function with a new processRoutes recursive function
  • Changed the children processing from a simple map operation to a recursive traversal that handles nested route structures

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Jan 20, 2026

Preview build of published Zudoku package for commit 61ecb75.

See the deployment at: https://2d6c5b79.cosmocargo-public-package.pages.dev

Note

This is a preview of the Cosmo Cargo example using the Zudoku package published to a local registry to ensure it'll be working when published to the public NPM registry.

Last updated: 2026-01-20T14:46:44.122Z

@dan-lee dan-lee force-pushed the fix/recursive-layout-handling branch from e69a061 to 61ecb75 Compare January 20, 2026 14:43
@dan-lee dan-lee changed the title Handle layout recursively on routes Inherit layout recursively on routes Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants