错误:<redirect>元素仅用于路由器配置

时间:2018-11-10 17:27:36

标签: react-router-v4

这是执行重定向的代码部分:

render() {
    return <div>
      <Router>
        <Switch>
          <Route path='/:locale(en|he)' component={this.routes} />

          <Redirect to="`${props.location.pathname}/he`"/>
        </Switch>
      </Router>
    </div>
  }

您知道如何解决此错误吗?

0 个答案:

没有答案