mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
@allow-large-files [Flow] Upgrade xplat/js to flow v0.63
Reviewed By: samwgoldman Differential Revision: D6675320 fbshipit-source-id: 85575a6f30a50a3c40c6b46ba36f8cd33c091b1d
This commit is contained in:
committed by
Facebook Github Bot
parent
e5c2a66897
commit
6b95c4fb14
@@ -462,6 +462,9 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
||||
}),
|
||||
);
|
||||
} else if (this.props.onViewableItemsChanged) {
|
||||
/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an
|
||||
* error found when Flow v0.63 was deployed. To see the error delete this
|
||||
* comment and run Flow. */
|
||||
this._virtualizedListPairs.push({
|
||||
viewabilityConfig: this.props.viewabilityConfig,
|
||||
onViewableItemsChanged: this._createOnViewableItemsChanged(
|
||||
@@ -555,6 +558,9 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
||||
.map((it, kk) => keyExtractor(it, index * numColumns + kk))
|
||||
.join(':');
|
||||
} else {
|
||||
/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an
|
||||
* error found when Flow v0.63 was deployed. To see the error delete this
|
||||
* comment and run Flow. */
|
||||
return keyExtractor(items, index);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -74,6 +74,9 @@ export type ViewabilityConfig = {|
|
||||
class ViewabilityHelper {
|
||||
_config: ViewabilityConfig;
|
||||
_hasInteracted: boolean = false;
|
||||
/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an error
|
||||
* found when Flow v0.63 was deployed. To see the error delete this comment
|
||||
* and run Flow. */
|
||||
_timers: Set<number> = new Set();
|
||||
_viewableIndices: Array<number> = [];
|
||||
_viewableItems: Map<string, ViewToken> = new Map();
|
||||
|
||||
@@ -589,6 +589,9 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
||||
if (this.props.initialScrollIndex) {
|
||||
this._initialScrollIndexTimeout = setTimeout(
|
||||
() =>
|
||||
/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses
|
||||
* an error found when Flow v0.63 was deployed. To see the error
|
||||
* delete this comment and run Flow. */
|
||||
this.scrollToIndex({
|
||||
animated: false,
|
||||
index: this.props.initialScrollIndex,
|
||||
@@ -615,6 +618,9 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
||||
tuple.viewabilityHelper.dispose();
|
||||
});
|
||||
this._fillRateHelper.deactivateAndFlush();
|
||||
/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an
|
||||
* error found when Flow v0.63 was deployed. To see the error delete this
|
||||
* comment and run Flow. */
|
||||
clearTimeout(this._initialScrollIndexTimeout);
|
||||
}
|
||||
|
||||
@@ -1176,6 +1182,9 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
||||
if (
|
||||
onEndReached &&
|
||||
this.state.last === getItemCount(data) - 1 &&
|
||||
/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an
|
||||
* error found when Flow v0.63 was deployed. To see the error delete this
|
||||
* comment and run Flow. */
|
||||
distanceFromEnd < onEndReachedThreshold * visibleLength &&
|
||||
(this._hasDataChangedSinceEndReached ||
|
||||
this._scrollMetrics.contentLength !== this._sentEndForContentLength)
|
||||
@@ -1298,6 +1307,9 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
||||
const distBottom =
|
||||
this._getFrameMetricsApprox(last).offset - (offset + visibleLength);
|
||||
const scrollingThreshold =
|
||||
/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an
|
||||
* error found when Flow v0.63 was deployed. To see the error delete
|
||||
* this comment and run Flow. */
|
||||
this.props.onEndReachedThreshold * visibleLength / 2;
|
||||
hiPri =
|
||||
Math.min(distTop, distBottom) < 0 ||
|
||||
@@ -1374,6 +1386,9 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
||||
const {contentLength, offset, visibleLength} = this._scrollMetrics;
|
||||
const distanceFromEnd = contentLength - visibleLength - offset;
|
||||
const renderAhead =
|
||||
/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses
|
||||
* an error found when Flow v0.63 was deployed. To see the error
|
||||
* delete this comment and run Flow. */
|
||||
distanceFromEnd < onEndReachedThreshold * visibleLength
|
||||
? this.props.maxToRenderPerBatch
|
||||
: 0;
|
||||
@@ -1481,6 +1496,9 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
||||
}
|
||||
}
|
||||
}
|
||||
/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an
|
||||
* error found when Flow v0.63 was deployed. To see the error delete this
|
||||
* comment and run Flow. */
|
||||
return frame;
|
||||
};
|
||||
|
||||
|
||||
@@ -233,6 +233,9 @@ class VirtualizedSectionList<SectionT: SectionBase> extends React.PureComponent<
|
||||
return {
|
||||
...viewable,
|
||||
index: info.index,
|
||||
/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an
|
||||
* error found when Flow v0.63 was deployed. To see the error delete this
|
||||
* comment and run Flow. */
|
||||
key: keyExtractor(viewable.item, info.index),
|
||||
section: info.section,
|
||||
};
|
||||
|
||||
@@ -89,6 +89,9 @@ module.exports = {
|
||||
|
||||
testBadSectionsShape(): React.Element<*> {
|
||||
const sections = [
|
||||
/* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an
|
||||
* error found when Flow v0.63 was deployed. To see the error delete this
|
||||
* comment and run Flow. */
|
||||
{
|
||||
key: 'a',
|
||||
items: [
|
||||
|
||||
Reference in New Issue
Block a user