<link to =“{}”not =“”working =“”/>

时间:2016-08-25 13:59:05

标签: reactjs react-router react-redux

我想在创建路由器对象的地方之外使用路由。我怎么能这样做?

<div className="col-sm-2 hidden-xs sidebar-container-wrapper">
  <Sidebar currentUrl={currentUrl}/>
</div>
<div className="col-sm-10 col-xs-12 groups-container-wrapper">
  <Provider store={ this.myStore }>
    <Router history={ history } onUpdate={() => window.scrollTo(0, 0)}>
      { routes }
    </Router>
  </Provider>
</div>

1 个答案:

答案 0 :(得分:1)

Programmatically push state。或者,将路由器下的链接设置为使用链接...

此外,HoC适用于较新版本。