2.0.8 • Published 5 years ago

react-fast-unmount v2.0.8

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

在数据加载还没完成 或者执行一些类似onscroll方法 ,组件销毁时后还改变数据报错如下:

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.

直接引用

import unject_unmount  from 'react-fast-unmount'
然后再 自己需要的类上 @unject_unmount 如下
@unject_unmount
class Home extends PureComponent {
    ....
}

当然 当你使用Decorator 修饰符的 你可能会遇到这样的报错

> SyntaxError: C:UsersAdministratorDesktoptetestsrcapp.js: Support for the experimental syntax 'decorators-legacy' isn't currently enabled (15:1):

那么欢迎点击这里进入我的github.

2.0.8

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.0

5 years ago