Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public componentWillUnmount() {
ViewportComponentEvents.onViewRotationChangeEvent.removeListener(this._handleViewRotationChangeEvent);
window.removeEventListener("mousedown", this._handleMouseDown as any);
window.removeEventListener("mouseup", this._handleMouseDragEnd as any);
window.removeEventListener("mousemove", this._handleMouseDrag as any);
window.removeEventListener("keyup", this._handleKeyUp as any);
clearTimeout(this._animationFrame);
if (this.props.onAnimationEnd)
this.props.onAnimationEnd();
const rt = document.getElementById("drawing-portal") as HTMLDivElement;
if (rt && rt.parentElement !== null && rt.children.length === 0) {
rt.parentElement.removeChild(rt);
}
this._mounted = false;
}
public componentWillUnmount() {
ViewportComponentEvents.onViewRotationChangeEvent.removeListener(this._handleViewRotationChangeEvent);
clearTimeout(this._animationFrame);
this._mounted = false;
}