How does react set the default route?

now you want to set articesList as the default route. Click the article tag in AppSider to go to articlesList route, and click on the article in ArticlesList to enter articleDetail Route
App.js

.
<Layout className="app-container">
  <AppSider />
  <AppContent />
</Layout>

AppContent

class AppContent extends React.Component {
  render() {
    return (
      <Content className="app-content bg-fff">
        <Switch>
          <Route path="/articleDetail" component={ArticleDetail} />
          <Route path="/articlesList/:tag" component={ArticlesList} />
        </Switch>
      </Content>
    )
  }
}
Jul.02,2022

let Routes = (<Router>
  <div>
    <Link activeClassName="active" exact={true} to={{pathname: '/index'}}></Link>
    <div className="route-content">
      <Switch>
        <Redirect path="/" to={{pathname: '/index'}} />
      </Switch>
    </div>
  </div>
</Router>)

exact and Redirect will be fine


< Redirect path= "/" exact= {true} to= "/ articesList" / >

Menu