This is how I use it, and I don't think there should be much of a problem:
export const ListScreen = ()=>{
return (
<>
<h1>ListScreen</h1>
<Link to={"/kanban"}>kanban</Link>
<Link to={"/epic"} >epic</Link>
<Routes>
<Route path={"kanban"} element={<KanbanScreen/>}/>
<Route path={"epic"} element={<EpicScreen/>}/>
<Navigate to={window.location.pathname + "/kanban"}/>
</Routes>
</>
)
}
I am using react-router version 6.2.1