组件销毁的时候要将异步请求撤销

在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”

https://segmentfault.com/a/1190000017186299?utm_source=tag-newest