Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public componentDidMount = () => {
const sz = document.getElementById("editor-zone") as HTMLDivElement;
this.editor = new CanvasTools.Editor(sz);
this.editor.autoResize = false;
this.editor.onSelectionEnd = this.onSelectionEnd;
this.editor.onRegionMoveEnd = this.onRegionMoveEnd;
this.editor.onRegionDelete = this.onRegionDelete;
this.editor.onRegionSelected = this.onRegionSelected;
this.editor.AS.setSelectionMode({ mode: this.props.selectionMode });
window.addEventListener("resize", this.onWindowResize);
}