欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

react-router 路由

程序员文章站 2022-03-26 13:54:04
...
ReactDOM.render(
    <Router history={hashHistory}>
        <Route path="/" component={App}>
            <IndexRoute component={Home}/>
            <Route path="*" component={Home}/>
            <Route path="/login" component={Login}/>
        </Route>
    </Router>,
    document.getElementById('root'));

内层路由

<Router history={hashHistory}>
    <Route path="/userc" component={UserC}/>
    <Route path="/membersearch" component={MemberSearch} />
</Router>