尝试匹配两个 URL 参数时发出警告

Warning when trying to match two URL parameters

我第一次将 React-Routing 合并到 React 应用程序中。

我的本意是在URL中嵌入两个变量,比如

/project/ABC/person/123

其中 ABC 是项目 ID,人员 123 是人员 ID。

我设置了以下路由。

<Router>
    <Route path="/" component={App}>
        <IndexRoute component={PageIndex}/>
        <Route path="about" component={PageAbout}/>
        <Route path="people/:projectId" component={PagePeople}>
            <Route path="person/:personId" component={Person}/>
        </Route>
    </Route>
</Router>

应用程序实际运行并正常运行,但浏览器抛出控制台错误。

警告:位置 "people/SE/person/2" 不匹配任何路线

有什么建议吗?

谢谢,

L.

你试过吗? 我认为它会很好。

<Router>
<Route path="/" component={App}>
    <IndexRoute component={PageIndex}/>
    <Route path="about" component={PageAbout}/>
    <Route path="people/:projectId" component={PagePeople}/>
    <Route path="people/:projectId/person/:personId" component={Person}/>
</Route>