0
路由器NOMATCH路线我有这样的结构反应动态路由
<Route path="user" component={Users}>
<Route path=":userId" component={User}>
<Route path=":project" component={Project}/>
<Route path="*" component={NotFound} />
</Route>
<Route path="*" component={NotFound} />
</Route>
<Route path="*" component={NotFound} />
不管我如何努力尝试设置<NoMatch />
,我总是能获得通过url
要么user id
或project id
这并不存在。我现在已经有两天了,这让我感到非常困惑,因为我迷失了互联网上不同的方法/答案,我感到非常困惑。
使用react-router v3.0.2
我不能使用用户ID数组检查':userId'路径吗? – nehel
我想你可以使用ID数组检查:userId路径,如果没有匹配,则重定向到notfound路由。 – paqash