ViewWithSize
Summary: fixing ts-strict errors Reviewed By: passy Differential Revision: D17181146 fbshipit-source-id: a0f8cab121c5fefd505cba4166122c1ce191e6c2
This commit is contained in:
committed by
Facebook Github Bot
parent
f34c8ba9fe
commit
4850da6a72
@@ -25,12 +25,11 @@ export default class ViewWithSize extends Component<
|
|||||||
this.state = {height: window.innerHeight, width: window.innerWidth};
|
this.state = {height: window.innerHeight, width: window.innerWidth};
|
||||||
}
|
}
|
||||||
|
|
||||||
_onResize: (event: UIEvent) => void;
|
_onResize = () => {
|
||||||
|
this.setState({height: window.innerHeight, width: window.innerWidth});
|
||||||
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this._onResize = () => {
|
|
||||||
this.setState({height: window.innerHeight, width: window.innerWidth});
|
|
||||||
};
|
|
||||||
window.addEventListener('resize', this._onResize);
|
window.addEventListener('resize', this._onResize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user