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