react路由参数改变不重新渲染页面

  1. 问题描述:
    从
    /test/1
    跳转到
    /test/2
    ,url改变了,页面没重新渲染
  2. 解决办法(先跳转到其它页面,再跳转到目标页面):
    this.props.history.push("/another")
    var $this = this
    setTimeout(function(){
    $this.props.history.push("/destination/"+param)
    },100)

猜你喜欢

转载自blog.51cto.com/12173069/2145019