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.