How to define multi segment url like /project/collaborator in react router 5

Viewed 45

I am trying to define a multi-segment URL in react-router-dom but unfortunately, it's not working, can anyone let me know where is the problem?

<React.Fragment>
      <Router>
        <Switch>

          <Layout path="/" component={HComponent} exact /> //working
          <Layout path="/calender" component={CComponent} exact /> // working
          
          //Not working
          <Layout path="/calender/today" component={CComponent} exact />

        </Switch>
      </Router>
</React.Fragment>

Where do I need to change?

0 Answers
Related