反应路由器重定向未定义?

Joh*_*ohn 4 react-router

这就是我的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'))
Run Code Online (Sandbox Code Playgroud)

但是当我进入我的页面时,我在控制台中收到此错误

未捕获的ReferenceError:未定义重定向

/home如果用户的目的地与上述任何路径路径不匹配,我如何告诉react-router将用户重定向到?

Vla*_*nov 12

你只需要添加

import { Redirect } from 'react-router';
Run Code Online (Sandbox Code Playgroud)

在文件的顶部