如何解决 react-router 跳转当前路由不刷新问题?

如,我当前的路由是/manage/user,现在我点击跳转操作:this.props.history.push('/manage/user'),页面没有变化,如何解决?

阅读 8.7k
3 个回答
Hash history cannot PUSH the same path; a new entry will not be added to the history stack

你的目的是什么?
刷新当前数据?

不然你想要啥变化...

如果数据要变化,你要请求新的值,比如user换了,你可以直接请求此用户的数据,然后页面重新渲染

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