用react在componentDidMount下ajax 偶尔会出现这种错误
Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the Timer component.
大概是从DOM中移除了react组件,这时才调用setState改变组件的状态
但是印象里vue好像不会出现类似的报错
是因为渲染机制的不同吗?
请大神们赐教 谢谢
这是警告,不是错误,你不管他也没什么太大关系
如果有强迫症的话可以加入下面的代码解决