Use componentWillUnmount
This commit is contained in:
parent
9abf1f0fcd
commit
e97b078088
1 changed files with 1 additions and 1 deletions
|
@ -70,7 +70,7 @@ export class Lightbox extends React.Component<Props, {}> {
|
||||||
document.addEventListener('keyup', this.onKeyUp, useCapture);
|
document.addEventListener('keyup', this.onKeyUp, useCapture);
|
||||||
}
|
}
|
||||||
|
|
||||||
public componentWillMount() {
|
public componentWillUnmount() {
|
||||||
const useCapture = true;
|
const useCapture = true;
|
||||||
document.removeEventListener('keyup', this.onKeyUp, useCapture);
|
document.removeEventListener('keyup', this.onKeyUp, useCapture);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue