Reactjs React路由器不活动';不要为儿童路线而工作
我有以下路由器Reactjs React路由器不活动';不要为儿童路线而工作,reactjs,react-router,Reactjs,React Router,我有以下路由器 <Route path="/" component={App}> <IndexRoute component={Home}/> <Route name="events" path="/events" component={Events}> <Route path=":eventId" component={Details}/> </Route> </Route> 也尝试了(没有/),但没
<Route path="/" component={App}>
<IndexRoute component={Home}/>
<Route name="events" path="/events" component={Events}>
<Route path=":eventId" component={Details}/>
</Route>
</Route>
也尝试了
(没有/
),但没有成功。
当浏览
/events/1234
时,您知道如何将isActive
设置为true
吗?子项需要以这种方式配置
这不起作用:位置“events/1246”与任何路由都不匹配。尽管如此,如果我删除/
路由可以工作,但isActive仍然为false
<Route path="/" component={App}>
<IndexRoute component={Home}/>
<Route name="events" path="/events" component={Events}>
<Route path="/events/:eventId" component={Details}/>
</Route>