在当前页面点击按钮想重新加载却发现react不刷新当前页面,提示
Warning: You cannot PUSH the same path using hash history
解决方法:只需要新建一个空白页面.先跳转到空白页面.再从空白页面跳转到当前页面即可
index.jsx页面执行:
hashHistory.push({ pathname: '/blank',//空白页面 //pathname: 'app/index',
})
blank页面执行跳转:
componentWillMount(){ hashHistory.push({ pathname: 'app/index',//返回当前页面 }) }