鍍金池/ 問答/HTML5  HTML/ react-router4.0二級默認(rèn)路由如何設(shè)置

react-router4.0二級默認(rèn)路由如何設(shè)置

默認(rèn)顯示users/one,要如何進(jìn)行設(shè)置?
clipboard.png

clipboard.png

回答
編輯回答
傲嬌范

可以用重定向
<BrowserRouter

forceRefresh={!('pushState' in history)}
keyLength={12}
<Switch>
    < Route exact path="/" render={() => <Redirect to="/users/one"}/>
</Switch>

</BrowserRouter>

2017年12月19日 19:12