ResizeSensor

Summary: _typescript_

Reviewed By: danielbuechele

Differential Revision: D17181422

fbshipit-source-id: 73b802ac339c7f7e474c9ee8f13b6aaa50884c97
This commit is contained in:
Chaiwat Ekkaewnumchai
2019-09-05 03:02:02 -07:00
committed by Facebook Github Bot
parent d7e3514d9b
commit 158f7cba33

View File

@@ -39,14 +39,14 @@ export default class ResizeSensor extends Component<{
componentDidMount() {
const {iframe} = this;
if (iframe != null) {
if (iframe != null && iframe.contentWindow != null) {
iframe.contentWindow.addEventListener('resize', this.handleResize);
}
}
componentWillUnmount() {
const {iframe} = this;
if (iframe != null) {
if (iframe != null && iframe.contentWindow != null) {
iframe.contentWindow.removeEventListener('resize', this.handleResize);
}
}