From 4850da6a72c85898703b1aade5f6b5f07982b3f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=BCchele?= Date: Thu, 5 Sep 2019 04:40:39 -0700 Subject: [PATCH] ViewWithSize Summary: fixing ts-strict errors Reviewed By: passy Differential Revision: D17181146 fbshipit-source-id: a0f8cab121c5fefd505cba4166122c1ce191e6c2 --- src/ui/components/ViewWithSize.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ui/components/ViewWithSize.tsx b/src/ui/components/ViewWithSize.tsx index d0b3c2760..6c3ea2c20 100644 --- a/src/ui/components/ViewWithSize.tsx +++ b/src/ui/components/ViewWithSize.tsx @@ -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); }