【React Native】错误提示: 在React开发中,我们可能经常会遇到这个一个警告: Can't perform a React state update on an unmounted component.

  
  在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,防止出现内存泄漏的情况。

posted @ 2020-02-26 22:47  Mr·Xu  阅读(352)  评论(0编辑  收藏  举报