<Router>
<Route path={["/home", "/users", "/widgets"]} component={Home} />
</Router>
<Router>
<Route path={["/home", "/users", "/widgets"]} component={Home} />
</Router>
<Router>
{["/home", "/users", "/widgets"].map((path, index) =>
<Route path={path} component={Home} key={index} />
)}
</Router>
import React from "react";
import {
BrowserRouter as Router,
useRoutes,
} from "react-router-dom";
const App = () => useRoutes([
{ path: "/home", element: <Home /> },
{ path: "/users", element: <Home /> },
{ path: "/widgets", element: <Home /> }
]);
const AppWrapper = () => (
<Router>
<App />
</Router>
);