I have a route that renders a component.
I would like that component to then internally render something based on a nested route.
Something like:
function Foo() {
return (
<div>
<header>title</header>
<Route path="bar" element={<Bar />} />
<Route path="cof" element={<Cof />} />
</div>
);
}
...
<Route path="foo" element={<Foo />} />
But this fails and Foo doesn't even render.
If I remove the nested routes inside Foo, then Foo renders normally.
How do I make this work?
I expect that at address /foo/bar, I would get the Foo component with the internal component for Bar.