Skip to content

[v6][Bug]: Different behavior between flat paths and nested paths #8458

@Isammoc

Description

@Isammoc

What version of React Router are you using?

6.0.2

Steps to Reproduce

https://stackblitz.com/edit/github-fjqy5d?file=src/App.tsx

routes = [ {
  path: 'doesnotwork'
  children: [
    {
      path: '*',
      element: <InnerRoutes />
    }
  ]
]

function InnerRoutes() {
  return (
    <Routes>
      <Route path="a" element={<h1>Subpath A</h1>} />
      <Route path="*" element={<h1>Not found!</h1>} />
    </Routes>
  );
}

Expected Behavior

The path doesnotwork/a should display the subpath a

Actual Behavior

The InnerRoutes' Routes element does not render the corresponding Route element to subpath.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions