VirtualScroller: aggressively cleanup refs

Prevents a memory leak, as it appears React holds onto the class
instance after unmounting
This commit is contained in:
Liam Fitzgerald 2021-04-24 12:20:42 +10:00
parent bc4f26b2b3
commit 6a1f0e2ac9
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB

View File

@ -222,9 +222,8 @@ export default class VirtualScroller<T> extends Component<VirtualScrollerProps<T
if(this.cleanupRefInterval) { if(this.cleanupRefInterval) {
clearInterval(this.cleanupRefInterval); clearInterval(this.cleanupRefInterval);
} }
if(this.initScroll) { this.cleanupRefs();
clearTimeout(this.initScroll); this.childRefs.clear();
}
} }
startOffset() { startOffset() {