【发布时间】:2017-05-10 15:13:16
【问题描述】:
这就是我的 react-router 代码的样子
render((
<Router history={browserHistory}>
<Route path={CORP} component={App}>
<IndexRoute component={Home} />
<Route path={"outreach"} component={OutReach}/>
<Route path={"careers/m"} component={Career}/>
<Route path={"members"} component={Members}/>
<Redirect from="*" to={"/home"} />
</Route>
</Router>
), document.getElementById('app'))
但是当我转到我的页面时,我在控制台中收到此错误
未捕获的引用错误:未定义重定向
我如何告诉 react-router 仅当用户的目的地与上述任何路由路径都不匹配时才将用户重定向到/home?
【问题讨论】:
标签: react-router