From ffd4a29bbae89bee58ecd895fac8f1ce63a5eba4 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] VirtualList Summary: fixing ts-strict errors Reviewed By: passy Differential Revision: D17181140 fbshipit-source-id: 0b67a744c7fa5d3ef3aad9212e52d1397d873d4d --- src/ui/components/VirtualList.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/components/VirtualList.tsx b/src/ui/components/VirtualList.tsx index 6dd97f12e..853b74331 100644 --- a/src/ui/components/VirtualList.tsx +++ b/src/ui/components/VirtualList.tsx @@ -61,7 +61,7 @@ export default class VirtualList extends Component< overscanCount: 10, }; - ref: HTMLElement; + ref: HTMLElement | undefined; setRef = (ref: HTMLElement) => { this.ref = ref; @@ -74,7 +74,7 @@ export default class VirtualList extends Component< }; handleScroll = () => { - this.setState({offset: this.ref.scrollTop}); + this.setState({offset: this.ref ? this.ref.scrollTop : 0}); if (this.props.sync === true) { this.forceUpdate(); }