ViewWithSize

Summary: fixing ts-strict errors

Reviewed By: passy

Differential Revision: D17181146

fbshipit-source-id: a0f8cab121c5fefd505cba4166122c1ce191e6c2
This commit is contained in:
Daniel Büchele
2019-09-05 04:40:39 -07:00
committed by Facebook Github Bot
parent f34c8ba9fe
commit 4850da6a72

View File

@@ -25,12 +25,11 @@ export default class ViewWithSize extends Component<
this.state = {height: window.innerHeight, width: window.innerWidth};
}
_onResize: (event: UIEvent) => void;
_onResize = () => {
this.setState({height: window.innerHeight, width: window.innerWidth});
};
componentDidMount() {
this._onResize = () => {
this.setState({height: window.innerHeight, width: window.innerWidth});
};
window.addEventListener('resize', this._onResize);
}