在React开发中,我们可能经常会遇到这个一个警告:
Can't perform a React state update on an unmounted component.
This is a no-op, but it indicates a memory leak in your application.
To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method”
不能在组件销毁后设置state,防止出现内存泄漏的情况。