score:0

    import { Switch, Route, Router } from "react-router-dom";
    import Home from '.....path'
    //import all routing componets
    
    const Routes = () => {
     return(
    <Switch>
     <Route exact path='/' component={Home}>
     <Route exact path='/comp1' component={Comp1}>
     <Route exact path='/comp2' component={Comp2}>
   </Switch>)}

  

   const App = () => {
    <Router>
      <GlobalNav />
      <Container fluid={true}>
        <SideNav />
        <Routes />
      </Container>
    </Router>}

score:1

import { Navbar, Footer, Home } from './components';

ReactDOM.render(
    <Router>
      <NavBar />
      <Routes>
        <Route path="/" element={<Home />} />
      </Routes>
      <Footer />
    </Router>,
    document.getElementById("root")
);

Related Query

More Query from same tag