Path 反应路由器从上层组件获取当前路由
我有这样的想法:Path 反应路由器从上层组件获取当前路由,path,react-router,Path,React Router,我有这样的想法: render( <Router history={ hashHistory }> <Route path="/" component={ App } > <IndexRoute component={ Home }/> <Route path="/a" component={ A }/> <Route path="/b" component={ B }/> <
render(
<Router history={ hashHistory }>
<Route path="/" component={ App } >
<IndexRoute component={ Home }/>
<Route path="/a" component={ A }/>
<Route path="/b" component={ B }/>
</Route>
</Router>,
document.getElementById('root')
);
渲染(
,
document.getElementById('root'))
);
我想获取应用程序组件上的当前位置。我怎样才能做到这一点?已尝试使用此.props.location
,但它是未定义的
。
我正在使用react路由器3.0.0