react-router-redux 4 中使用routerActions.push('/customerMain')跳转

新手上路,请多包涵

比如我登录成功后,需要跳转到指定的页面,我这里使用 react-router-redux 4 的dispatch(routerActions.push('/customerMain'))跳转,url改变但页面不刷新。actct-router-redux

阅读 9.8k
4 个回答

应该没有使用withRouter的包裹redux的connect,可以在route中引入container统一调取,这样action中可以使用routerActions.push、replace等

新手上路,请多包涵

这个问题的主要原因还没有找到,但是可以使用this.props.history.push('/customerMain')来进行跳转

新手上路,请多包涵
新手上路,请多包涵

我也遇到与楼主相同的问题,react-redux把props覆盖后,没有history了,用不了this.props.history.push('/').同时用store.dispath(push('/')) 只url导航会变化,但页面却不会更新。。。问题还在纠结中。。。。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进