react IndexRoute与自定义组件

在学习react-router时,官网上用了IndexRoute来嵌套路由,并在外层的App组件中加入this.props.children 由于react-router已经弃用IndexRoute,所以当采用这种方式时,会出现如下报错 ‘IndexRoute’ is not exported from ‘react-router’。 于是将IndexRoute改为自定位组件,类似于Vue中引入组
相关文章
相关标签/搜索