react IndexRoute與自定義組件

在學習react-router時,官網上用了IndexRoute來嵌套路由,並在外層的App組件中加入this.props.children 由於react-router已經棄用IndexRoute,所以當採用這種方式時,會出現如下報錯 ‘IndexRoute’ is not exported from ‘react-router’。 於是將IndexRoute改爲自定位組件,類似於Vue中引入組
相關文章
相關標籤/搜索