Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow path on index routes #8144

Closed
mjackson opened this issue Oct 19, 2021 · 1 comment
Closed

Allow path on index routes #8144

mjackson opened this issue Oct 19, 2021 · 1 comment
Assignees

Comments

@mjackson
Copy link
Member

mjackson commented Oct 19, 2021

We should allow index routes to have a path. This eliminates the need to nest them inside their parent route.

e.g. this should be a totally valid route config:

let routes = (
  <Routes>
    <Route path="layout" element={...}>
      <Route path="page" element={...} />
    </Route>
    <Route path="layout" index element={...} />
  </Routes>
);

Implementation

I don't think any implementation actually needs to change here, just the IndexRouteProps declaration. But we should write a test or two just to be sure.

@mjackson
Copy link
Member Author

Fixed in #8148

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

No branches or pull requests

2 participants