Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tischsoic committed Sep 10, 2024
1 parent e9a25e0 commit e442fcb
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,12 @@ export default class DropAreaComponent extends Component {
window.addEventListener('drop', this.props.preventDefaultAction, false);
window.addEventListener('dragover', this.props.preventDefaultAction, false);

if (this._refForm.current) {
this._refForm.current.addEventListener('drop', this.handleUpload, false);
}
this._refForm.current.addEventListener('drop', this.handleUpload, false);
}

componentWillUnmount() {
window.removeEventListener('drop', this.props.preventDefaultAction, false);
window.removeEventListener('dragover', this.props.preventDefaultAction, false);

if (this._refForm.current) {
this._refForm.current.removeEventListener('drop', this.handleUpload, false);
}
}

render() {
Expand Down

0 comments on commit e442fcb

Please sign in to comment.