报错信息是:
Warning: Can only update a mounted or mounting component. This usually means you called setState, replaceState, or forceUpdate on an unmounted component. This is a no-op.
步骤为:
有两个页面,a和b,都是antd的table,在column中render了一个按钮
<a key={'btn-delete'} onClick={() => {
this.setState({
b: Date.now()
})
}}>删除</a>
如果现在用this.props.history.push('/b')跳转到b,然后再用this.props.history.push('/a')跳转到a,此时点击删除,就会报这个错,但是如果刷新页面,点击就不会报错
求大神
提示的很明显,但你的这段代码看不出问题。