A Router may have only one child element
生活随笔
收集整理的這篇文章主要介紹了
A Router may have only one child element
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
報錯
代碼如下:
export default class App extends Component {render(){return(<HashRouter><Route path='/index' component={index}></Route><Route path='/:id' component={mine}></Route></HashRouter>)} }解決:這里提示Router中只能有一個Route配置,刪掉一個就可以了,如果想要配置多路由,用一個div把這兩個Route包起來就好了
總結
以上是生活随笔為你收集整理的A Router may have only one child element的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 数组去重(包括es6)
- 下一篇: git处理换行符问题,webstorm设