Giving the following sandbox, not sure to understand how to render the Bb component
import React from "react";
import "./styles.css";
import { Routes, Route } from "react-router";
import { BrowserRouter } from "react-router-dom";
export default function App() {
return (
<BrowserRouter>
<Routes>
<Route path="a" element={<Aa />}>
<Route path="b" element={<Bb />} />
</Route>
</Routes>
</BrowserRouter>
);
}
function Aa() {
return (
<p>
Hello
</p>
);
}
function Bb() {
return <p>World</p>;
}
https://codesandbox.io/s/still-shadow-337zc?file=/src/App.js
browsing to /a/b only renders Aa component