Skip to content

[v6] feature suggestion: possibility to use nested routes with absolute paths #7335

@smashercosmo

Description

@smashercosmo

I want to be able to do the following

routes.js

<Router>
  <Route path="/some-url" element={<SomeElement />}>
      <Route path="/some-url/some-other-url" element={<SomeOtherElement />}>
  </Route>
</Router>

SomeElement.js

<div>
  <h1>SomeElement</h1>
  <Outlet />
</div>

SomeOtherElement.js

<div>Some other element</div>

And if user lands on /some-url/some-other-url, he should see

<div>
  <h1>SomeElement</h1>
  <div>Some other element</div>
</div>

Motivation:
All paths in our app are defined as absolute paths like this

paths.js

export const SOME_URL = '/some-url'
export const SOME_OTHER_URL = '/some-url/some-other-url'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions