Use `componentWillUnmount`

pull/1/head
Daniel Gasienica 8 years ago
parent 9abf1f0fcd
commit e97b078088

@ -70,7 +70,7 @@ export class Lightbox extends React.Component<Props, {}> {
document.addEventListener('keyup', this.onKeyUp, useCapture);
}
public componentWillMount() {
public componentWillUnmount() {
const useCapture = true;
document.removeEventListener('keyup', this.onKeyUp, useCapture);
}

Loading…
Cancel
Save