Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs react路由器中的IndexRoute_Reactjs_React Router - Fatal编程技术网

Reactjs react路由器中的IndexRoute

Reactjs react路由器中的IndexRoute,reactjs,react-router,Reactjs,React Router,由于react路由器不再支持IndexRoute,如何呈现子组件 我有以下组成部分: 类应用程序扩展组件{ render(){ 返回( {this.props.children} [ ] ); } } 我想能够呈现应用程序的所有时间和内部,一个组件取决于URL。对于root,我希望呈现欢迎组件。这是以前可以实现的: v4中没有路由嵌套。您需要在组件中定义管线 将上面的设置更改为 <Router history={browserHistory}> <Route path=

由于react路由器不再支持IndexRoute,如何呈现子组件

我有以下组成部分:

类应用程序扩展组件{
render(){
返回(
{this.props.children}
[  ]
);
}
}
我想能够呈现应用程序的所有时间和内部,一个组件取决于URL。对于root,我希望呈现欢迎组件。这是以前可以实现的:


v4中没有路由嵌套。您需要在组件中定义管线

将上面的设置更改为

<Router history={browserHistory}>
  <Route path="/" component={App} />
</Router>
...
<Route path="life" component={Life} />
<Route
    exact
    path="/"
    component={Welcome}
/>
...