How to distinguish between two page structures when using react-router

encountered the following scenario when developing the page:

Log in to the registration page, and the other pages (such as home page and details page) have different structures, but the other pages have the same page skeleton, such as the same head and the same sidebar. How to tell the difference when writing a route

current index file (login and registration page not added)

<BrowserRouter>
  <React.Fragment>
    <Header />
    <div className="container">
      <div className="left-side">
        <Sider />
      </div>
      <div className="content">
        <ContentHeader />
        <Switch>
          <Route path="/" exact component={ Home } pageName={""} />
          <Route path="/detail" exact component={ Detail} pageName={""} />
        </Switch>
      </div>
    </div>
  </React.Fragment>
</BrowserRouter>

so how do you add a login page to the page? the login page does not contain Sider Header and other things


you can think of login as a component, and the contents of your React.Fragment can be ok as a component


put the same one outside the Router, and different ones into the Router.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9ad90-180d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9ad90-180d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?