Skip to content

Commit 3fd90b9

Browse files
committed
Update flow to 0.109
Add $FlowFixMe to vendor code that produces flow errors
1 parent 9e7c371 commit 3fd90b9

File tree

12 files changed

+28
-8
lines changed

12 files changed

+28
-8
lines changed

.flowconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
[version]
2-
^0.98.0
2+
^0.109.0
33

44
[ignore]
55
<PROJECT_ROOT>/.*/__tests__/.*
66
<PROJECT_ROOT>/packages/.*/dist/.*
77
<PROJECT_ROOT>/packages/examples/.*
8-
<PROJECT_ROOT>/packages/react-native-web/src/vendor/.*
98
<PROJECT_ROOT>/packages/website/.*
109
.*/node_modules/babel-plugin-transform-react-remove-prop-types/*
1110

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"eslint-config-prettier": "^6.4.0",
5151
"eslint-plugin-promise": "^4.2.1",
5252
"eslint-plugin-react": "^7.16.0",
53-
"flow-bin": "0.98.0",
53+
"flow-bin": "^0.109.0",
5454
"glob": "^7.1.2",
5555
"husky": "^3.0.8",
5656
"inline-style-prefixer": "^5.0.3",

packages/react-native-web/src/exports/Touchable/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,10 @@ const TouchableMixin = {
683683
this.state.touchable.positionOnActivate &&
684684
Position.release(this.state.touchable.positionOnActivate);
685685
this.state.touchable.dimensionsOnActivate &&
686+
// $FlowFixMe
686687
BoundingDimensions.release(this.state.touchable.dimensionsOnActivate);
687688
this.state.touchable.positionOnActivate = Position.getPooled(globalX, globalY);
689+
// $FlowFixMe
688690
this.state.touchable.dimensionsOnActivate = BoundingDimensions.getPooled(w, h);
689691
},
690692

packages/react-native-web/src/vendor/react-native/Animated/AnimatedImplementation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,4 +698,4 @@ const AnimatedImplementation = {
698698
__PropsOnlyForTests: AnimatedProps,
699699
};
700700

701-
export default AnimatedImplementation
701+
export default AnimatedImplementation;

packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedInterpolation.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ class AnimatedInterpolation extends AnimatedWithChildren {
348348
}
349349

350350
__transformDataType(range: Array<any>) {
351+
// $FlowFixMe
351352
return range.map(NativeAnimatedHelper.transformDataType);
352353
}
353354

packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedValueXY.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ let _uniqueId = 1;
2727
class AnimatedValueXY extends AnimatedWithChildren {
2828
x: AnimatedValue;
2929
y: AnimatedValue;
30+
// $FlowFixMe
3031
_listeners: {[key: string]: {x: string, y: string}};
3132

3233
constructor(
@@ -134,6 +135,7 @@ class AnimatedValueXY extends AnimatedWithChildren {
134135
*
135136
* See http://facebook.github.io/react-native/docs/animatedvaluexy.html#addlistener
136137
*/
138+
// $FlowFixMe
137139
addListener(callback: ValueXYListenerCallback): string {
138140
const id = String(_uniqueId++);
139141
const jointCallback = ({value: number}) => {

packages/react-native-web/src/vendor/react-native/FlatList/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
491491
_listRef: ?React.ElementRef<typeof VirtualizedList>;
492492
_virtualizedListPairs: Array<ViewabilityConfigCallbackPair> = [];
493493

494+
// $FlowFixMe
494495
_captureRef = ref => {
495496
this._listRef = ref;
496497
};

packages/react-native-web/src/vendor/react-native/SectionList/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ class SectionList<SectionT: SectionBase<any>> extends React.PureComponent<
316316
}
317317

318318
_wrapperListRef: ?React.ElementRef<typeof VirtualizedSectionList>;
319+
// $FlowFixMe
319320
_captureRef = ref => {
321+
// $FlowFixMe
320322
this._wrapperListRef = ref;
321323
};
322324
}

packages/react-native-web/src/vendor/react-native/ViewabilityHelper/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,11 @@ class ViewabilityHelper {
232232
}
233233

234234
_onUpdateSync(
235+
// $FlowFixMe
235236
viewableIndicesToCheck,
237+
// $FlowFixMe
236238
onViewableItemsChanged,
239+
// $FlowFixMe
237240
createViewToken,
238241
) {
239242
// Filter out indices that have gone out of view since this call was scheduled.

packages/react-native-web/src/vendor/react-native/VirtualizedList/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
10371037
_updateCellsToRenderBatcher: Batchinator;
10381038
_viewabilityTuples: Array<ViewabilityHelperCallbackTuple> = [];
10391039

1040+
// $FlowFixMe
10401041
_captureScrollRef = ref => {
10411042
this._scrollRef = ref;
10421043
};
@@ -1049,6 +1050,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
10491050
);
10501051
}
10511052

1053+
// $FlowFixMe
10521054
_defaultRenderScrollComponent = props => {
10531055
const onRefresh = props.onRefresh;
10541056
if (this._isNestedWithSameOrientation()) {
@@ -1084,6 +1086,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
10841086
}
10851087
};
10861088

1089+
// $FlowFixMe
10871090
_onCellLayout(e, cellKey, index) {
10881091
const layout = e.nativeEvent.layout;
10891092
const next = {
@@ -1190,14 +1193,17 @@ class VirtualizedList extends React.PureComponent<Props, State> {
11901193
this._maybeCallOnEndReached();
11911194
};
11921195

1196+
// $FlowFixMe
11931197
_onLayoutEmpty = e => {
11941198
this.props.onLayout && this.props.onLayout(e);
11951199
};
11961200

1201+
// $FlowFixMe
11971202
_onLayoutFooter = e => {
11981203
this._footerLength = this._selectLength(e.nativeEvent.layout);
11991204
};
12001205

1206+
// $FlowFixMe
12011207
_onLayoutHeader = e => {
12021208
this._headerLength = this._selectLength(e.nativeEvent.layout);
12031209
};
@@ -1460,6 +1466,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
14601466
}
14611467
}
14621468

1469+
// $FlowFixMe
14631470
_onScrollBeginDrag = (e): void => {
14641471
this._nestedChildLists.forEach(childList => {
14651472
childList.ref && childList.ref._onScrollBeginDrag(e);
@@ -1471,6 +1478,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
14711478
this.props.onScrollBeginDrag && this.props.onScrollBeginDrag(e);
14721479
};
14731480

1481+
// $FlowFixMe
14741482
_onScrollEndDrag = (e): void => {
14751483
const {velocity} = e.nativeEvent;
14761484
if (velocity) {
@@ -1480,6 +1488,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
14801488
this.props.onScrollEndDrag && this.props.onScrollEndDrag(e);
14811489
};
14821490

1491+
// $FlowFixMe
14831492
_onMomentumScrollEnd = (e): void => {
14841493
this._scrollMetrics.velocity = 0;
14851494
this._computeBlankness();

0 commit comments

Comments
 (0)