VirtualList

Summary: fixing ts-strict errors

Reviewed By: passy

Differential Revision: D17181140

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

View File

@@ -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();
}