是否可以在react路由器中创建嵌套路由而不是父路由?

在我的react项目中,我有一条路线,里面有多条路线

<Route path="/journeys/journey1" component={Journey1} />

在Journey1组件中,我有多种不同的路线

class Joureny1 extends React.component {
      ...
      return (
                <Switch>
                  <Route
                    path={`/terms`} 
                    render={...}
                  />
                  ...
                    <Route component={PageNotFound} />
                </Switch>
            );
    }

Is it possible for the terms route to point to url/terms instead if url/journeys/journey1/terms

评论