第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在react-router v4中嵌套路由

在react-router v4中嵌套路由

拉丁的傳說 2019-11-04 10:13:05
我已經(jīng)在應(yīng)用程序中將React Router升級到了版本4。但是現(xiàn)在我得到了錯誤Warning: You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored此路由有什么問題?import {    Switch,    BrowserRouter as Router,    Route, IndexRoute, Redirect,    browserHistory} from 'react-router-dom'   render((    <Router history={ browserHistory }>        <Switch>            <Route path='/' component={ Main }>                <IndexRoute component={ Search } />                <Route path='cars/:id' component={ Cars } />                <Route path='vegetables/:id' component={ Vegetables } />            </Route>            <Redirect from='*' to='/' />        </Switch>    </Router>), document.getElementById('main'))
查看完整描述

3 回答

?
qq_遁去的一_1

TA貢獻(xiàn)1725條經(jīng)驗 獲得超8個贊

嵌套路由在版本react-router 4.x中不可用。這是一個直接來自react-router 文檔的基本示例 ,說明如何在v4.x中嵌套secnarios。

查看完整回答
反對 回復(fù) 2019-11-04
  • 3 回答
  • 0 關(guān)注
  • 1833 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號