Skip to content

Commit e284385

Browse files
committed
fix(index): exit from checkVisibility when this.node is null
1 parent ded175a commit e284385

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export default class LazyFastdom extends Component {
2222

2323
componentDidMount() {
2424
this.mounted = true;
25-
2625
pendingList.add(this);
2726
this.checkVisibility();
2827
}
@@ -62,8 +61,10 @@ export default class LazyFastdom extends Component {
6261
};
6362
}
6463

64+
// This method is called asynchronously from a throttle function
65+
// inside PendingList instance.
6566
checkVisibility() {
66-
if (!this.mounted || this.checkingVisibility) return;
67+
if (!this.node || !this.mounted || this.checkingVisibility) return;
6768

6869
const offset = this.getOffset();
6970
const eventNode = this.getContainer();

0 commit comments

Comments
 (0)