React报错:Can‘t perform a React state update on an unmounted component. This is a no-op, but it ind...
React报错:Can’t perform a React state update on an unmounted component. This is a no-op, but it ind…原因是:我们不能在组件销毁后设置state,防止出现内存泄漏的情况 ,组件都被销毁了,还设了setstate处理解决的方案://利用生命周期钩子函数:componentWillUnmountcomponentWillUnmount() { this.setState = (state, callba