This fixes a warning on status unmounting (e.g. deletion).
This also resets IntersectionObserverWrapper on disconnect to avoid `unobserve()` calls
which has bug in Edge.
}
componentWillUnmount () {
+ if (this.props.intersectionObserverWrapper) {
+ this.props.intersectionObserverWrapper.unobserve(this.props.id, this.node);
+ }
+
this.componentMounted = false;
}
}
}
+ unobserve (id, node) {
+ if (this.observer) {
+ delete this.callbacks[id];
+ this.observer.unobserve(node);
+ }
+ }
+
disconnect () {
if (this.observer) {
+ this.callbacks = {};
this.observer.disconnect();
+ this.observer = null;
}
}