mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
fix flow suppression in VirtualizedList
Summary: flow 0.146 became more conservative about refinement invalidation, no longer accepting that `this.props.onViewableItemsChanged` is truthy. this was suppressed at the time. instead, we can assign to a const to restore typechecking. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D33743126 fbshipit-source-id: 0b1f0b83c2fe812e88b027c3b1d3d8aca7b09277
This commit is contained in:
1 parent
851e87a1a6
commit
203a82e90a
1 file changed
+8
-6
@@ -703,12 +703,14 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
||||
onViewableItemsChanged: pair.onViewableItemsChanged,
|
||||
}),
|
||||
);
|
||||
} else if (this.props.onViewableItemsChanged) {
|
||||
this._viewabilityTuples.push({
|
||||
viewabilityHelper: new ViewabilityHelper(this.props.viewabilityConfig),
|
||||
// $FlowFixMe[incompatible-call]
|
||||
onViewableItemsChanged: this.props.onViewableItemsChanged,
|
||||
});
|
||||
} else {
|
||||
const {onViewableItemsChanged, viewabilityConfig} = this.props;
|
||||
if (onViewableItemsChanged) {
|
||||
this._viewabilityTuples.push({
|
||||
viewabilityHelper: new ViewabilityHelper(viewabilityConfig),
|
||||
onViewableItemsChanged: onViewableItemsChanged,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
let initialState = {
|
||||
|
||||
Reference in new issue
Block a user