We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 078555e + 32dcb5e commit 72093a1Copy full SHA for 72093a1
src/LazyLoad.jsx
@@ -24,6 +24,7 @@ export default class LazyLoad extends Component {
24
}
25
26
componentDidMount() {
27
+ this._mounted = true;
28
const eventNode = this.getEventNode();
29
30
this.lazyLoadHandler();
@@ -47,6 +48,7 @@ export default class LazyLoad extends Component {
47
48
49
50
componentWillUnmount() {
51
+ this._mounted = false;
52
if (this.lazyLoadHandler.cancel) {
53
this.lazyLoadHandler.cancel();
54
@@ -77,6 +79,9 @@ export default class LazyLoad extends Component {
77
79
78
80
81
lazyLoadHandler() {
82
+ if (!this._mounted) {
83
+ return;
84
+ }
85
const offset = this.getOffset();
86
const node = findDOMNode(this);
87
0 commit comments