Reagieren Sie den Multiple -Pfad für den Router
<Router>
<Route path={["/home", "/users", "/widgets"]} component={Home} />
</Router>
Silly Skunk
<Router>
<Route path={["/home", "/users", "/widgets"]} component={Home} />
</Router>
//use multiple components in one Route:
<Route path='/path' render={props =>
<div>
<FirstChild />
<SecondChild />
</div>
} />
//use multiple components in one Route in version 6.0.2:
//this can be done by wrapping them in react fragments
import {BrowserRouter, Routes, Route} from "react-router-dom"
<BrowserRouter>
<Routes>
<Route path="/" element={<><Header/><Nav/><Etc./></>}/>
</Routes>
</BrowserRouter>
<Route path="/" element={[<Nav/>,<Home/>]} />