Skip to content

add new hoist property to routes#744

Merged
stackoverfloweth merged 1 commit intomainfrom
route-hoist
Mar 21, 2026
Merged

add new hoist property to routes#744
stackoverfloweth merged 1 commit intomainfrom
route-hoist

Conversation

@stackoverfloweth
Copy link
Copy Markdown
Contributor

This PR is an experimental POC that adds hoist to routes

const route = createRoute({
  parent,
  name: 'child',
  path: '/child',
  hoist: true,
})

Notice route has hoist: true. This means route will have a URL as though it were at the root of the route tree (ignores any ancestral url parts). This allows you to leverage the component nesting without having to use a nested URL. The child still inherits

  • hooks
  • matches (meaning parent components still render)
  • state
  • meta

This loosely follows the vue-router design of child paths that starts with "/".

@stackoverfloweth stackoverfloweth self-assigned this Mar 21, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 21, 2026

Deploy Preview for kitbag-router ready!

Name Link
🔨 Latest commit acd9723
🔍 Latest deploy log https://app.netlify.com/projects/kitbag-router/deploys/69beae6b890925000895f8d1
😎 Deploy Preview https://deploy-preview-744--kitbag-router.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

@pleek91 pleek91 left a comment

Choose a reason for hiding this comment

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

lol I expected this to be way more complex. It's like 4 lines of code 😂 the work you did on abstracting the URLs and params paid off here!

@stackoverfloweth stackoverfloweth merged commit 12ce6f1 into main Mar 21, 2026
6 checks passed
@stackoverfloweth stackoverfloweth deleted the route-hoist branch March 21, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants