diff --git a/.flowconfig b/.flowconfig index 77d5a1960577b1..1aa5fee5f31bd6 100644 --- a/.flowconfig +++ b/.flowconfig @@ -97,4 +97,4 @@ untyped-import untyped-type-import [version] -^0.88.0 +^0.89.0 diff --git a/.flowconfig.android b/.flowconfig.android index 140624a5723f7e..dcb06e6b45920d 100644 --- a/.flowconfig.android +++ b/.flowconfig.android @@ -97,4 +97,4 @@ untyped-import untyped-type-import [version] -^0.88.0 +^0.89.0 diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicator.js b/Libraries/Components/ActivityIndicator/ActivityIndicator.js index 2ad685e1df2dc1..9bb86373165494 100644 --- a/Libraries/Components/ActivityIndicator/ActivityIndicator.js +++ b/Libraries/Components/ActivityIndicator/ActivityIndicator.js @@ -110,10 +110,12 @@ const ActivityIndicator = ( ); }; -// $FlowFixMe - TODO T29156721 `React.forwardRef` is not defined in Flow, yet. const ActivityIndicatorWithRef = React.forwardRef(ActivityIndicator); ActivityIndicatorWithRef.displayName = 'ActivityIndicator'; +/* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.89 was deployed. To see the error, delete this comment + * and run Flow. */ ActivityIndicatorWithRef.defaultProps = { animating: true, color: Platform.OS === 'ios' ? GRAY : null, @@ -136,4 +138,7 @@ const styles = StyleSheet.create({ }, }); +/* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.89 was deployed. To see the error, delete this comment + * and run Flow. */ module.exports = (ActivityIndicatorWithRef: Class>); diff --git a/Libraries/Components/CheckBox/CheckBox.android.js b/Libraries/Components/CheckBox/CheckBox.android.js index fe5e23eafc5cf2..b8a7d3d765e522 100644 --- a/Libraries/Components/CheckBox/CheckBox.android.js +++ b/Libraries/Components/CheckBox/CheckBox.android.js @@ -190,9 +190,11 @@ const styles = StyleSheet.create({ */ type CheckBoxType = Class>; -// $FlowFixMe - TODO T29156721 `React.forwardRef` is not defined in Flow, yet. const CheckBoxWithRef = React.forwardRef(function CheckBoxWithRef(props, ref) { return ; }); +/* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ module.exports = (CheckBoxWithRef: CheckBoxType); diff --git a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js index 9512fd1dfabec2..efddfdd3b3ab32 100644 --- a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +++ b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js @@ -89,15 +89,20 @@ const ProgressBarAndroid = ( return ; }; -// $FlowFixMe - TODO T29156721 `React.forwardRef` is not defined in Flow, yet. const ProgressBarAndroidToExport = React.forwardRef(ProgressBarAndroid); +/* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ ProgressBarAndroidToExport.defaultProps = { styleAttr: 'Normal', indeterminate: true, animating: true, }; +/* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ module.exports = (ProgressBarAndroidToExport: Class< NativeComponent, >); diff --git a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js index 2d9ae4b17f5c5d..0c8a7708b5e80e 100644 --- a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js +++ b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js @@ -80,7 +80,9 @@ const styles = StyleSheet.create({ }, }); -// $FlowFixMe - TODO T29156721 `React.forwardRef` is not defined in Flow, yet. const ProgressViewIOSWithRef = React.forwardRef(ProgressViewIOS); +/* $FlowFixMe(>=0.89.0 site=react_native_ios_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ module.exports = (ProgressViewIOSWithRef: NativeProgressViewIOS); diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index f5503f0862d925..e6b8c5c27313ed 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -403,8 +403,8 @@ export type Props = $ReadOnly<{| * - `false`, deprecated, use 'never' instead * - `true`, deprecated, use 'always' instead */ - /* $FlowFixMe(>=0.86.0 site=react_native_fb) This comment suppresses an error - * found when Flow v0.86 was deployed. To see the error, delete this comment + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.89 was deployed. To see the error, delete this comment * and run Flow. */ keyboardShouldPersistTaps?: ?('always' | 'never' | 'handled' | false | true), /** diff --git a/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js b/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js index 540a31838b5a0b..aa447cf76fa05e 100644 --- a/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +++ b/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js @@ -127,7 +127,6 @@ const styles = StyleSheet.create({ }, }); -// $FlowFixMe - TODO T29156721 `React.forwardRef` is not defined in Flow, yet. const SegmentedControlIOSWithRef = React.forwardRef( ( props: SegmentedControlIOSProps, @@ -137,4 +136,7 @@ const SegmentedControlIOSWithRef = React.forwardRef( }, ); +/* $FlowFixMe(>=0.89.0 site=react_native_ios_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ module.exports = (SegmentedControlIOSWithRef: NativeSegmentedControlIOS); diff --git a/Libraries/Components/Slider/Slider.js b/Libraries/Components/Slider/Slider.js index 41f8f485b398ec..e768d5f8ff2d8d 100644 --- a/Libraries/Components/Slider/Slider.js +++ b/Libraries/Components/Slider/Slider.js @@ -250,9 +250,11 @@ const Slider = ( ); }; -// $FlowFixMe - TODO T29156721 `React.forwardRef` is not defined in Flow, yet. const SliderWithRef = React.forwardRef(Slider); +/* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.89 was deployed. To see the error, delete this comment + * and run Flow. */ SliderWithRef.defaultProps = { disabled: false, value: 0, @@ -274,4 +276,7 @@ if (Platform.OS === 'ios') { }); } +/* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.89 was deployed. To see the error, delete this comment + * and run Flow. */ module.exports = (SliderWithRef: Class>); diff --git a/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js b/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js index aa92f9cc9bd250..2a489a3fa84bb3 100644 --- a/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js +++ b/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js @@ -236,7 +236,6 @@ class ToolbarAndroid extends React.Component { } } -// $FlowFixMe - TODO T29156721 `React.forwardRef` is not defined in Flow, yet. const ToolbarAndroidToExport = React.forwardRef( ( props: ToolbarAndroidProps, @@ -246,6 +245,9 @@ const ToolbarAndroidToExport = React.forwardRef( }, ); +/* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ module.exports = (ToolbarAndroidToExport: Class< NativeComponent, >); diff --git a/Libraries/Components/Touchable/TouchableBounce.js b/Libraries/Components/Touchable/TouchableBounce.js index 16415a76528605..ff1b2d1d560d25 100644 --- a/Libraries/Components/Touchable/TouchableBounce.js +++ b/Libraries/Components/Touchable/TouchableBounce.js @@ -56,6 +56,9 @@ const TouchableBounce = ((createReactClass({ mixins: [Touchable.Mixin.withoutDefaultFocusAndBlur, NativeMethodsMixin], propTypes: { + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ ...TouchableWithoutFeedback.propTypes, // The function passed takes a callback to start the animation which should // be run after this onPress handler is done. You can use this (for example) @@ -86,6 +89,9 @@ const TouchableBounce = ((createReactClass({ getInitialState: function(): State { return { + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ ...this.touchableGetInitialState(), scale: new Animated.Value(1), }; @@ -181,13 +187,31 @@ const TouchableBounce = ((createReactClass({ nativeID={this.props.nativeID} testID={this.props.testID} hitSlop={this.props.hitSlop} + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder} onResponderTerminationRequest={ + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses + * an error found when Flow v0.89 was deployed. To see the error, + * delete this comment and run Flow. */ this.touchableHandleResponderTerminationRequest } + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ onResponderGrant={this.touchableHandleResponderGrant} + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ onResponderMove={this.touchableHandleResponderMove} + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ onResponderRelease={this.touchableHandleResponderRelease} + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ onResponderTerminate={this.touchableHandleResponderTerminate}> {this.props.children} {Touchable.renderDebugView({ diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index 23d6c756712dbc..4d1696cfcd5493 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -155,6 +155,9 @@ type Props = $ReadOnly<{| const TouchableHighlight = ((createReactClass({ displayName: 'TouchableHighlight', propTypes: { + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ ...TouchableWithoutFeedback.propTypes, /** * Determines what the opacity of the wrapped view should be when touch is @@ -200,9 +203,15 @@ const TouchableHighlight = ((createReactClass({ getDefaultProps: () => DEFAULT_PROPS, getInitialState: function() { + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ this._isMounted = false; if (this.props.testOnly_pressed) { return { + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ ...this.touchableGetInitialState(), extraChildStyle: { opacity: this.props.activeOpacity, @@ -213,6 +222,9 @@ const TouchableHighlight = ((createReactClass({ }; } else { return { + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ ...this.touchableGetInitialState(), extraChildStyle: null, extraUnderlayStyle: null, @@ -221,12 +233,21 @@ const TouchableHighlight = ((createReactClass({ }, componentDidMount: function() { + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ this._isMounted = true; ensurePositiveDelayProps(this.props); }, componentWillUnmount: function() { + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ this._isMounted = false; + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ clearTimeout(this._hideTimeout); }, @@ -244,13 +265,22 @@ const TouchableHighlight = ((createReactClass({ * defined on your component. */ touchableHandleActivePressIn: function(e: PressEvent) { + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ clearTimeout(this._hideTimeout); + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ this._hideTimeout = null; this._showUnderlay(); this.props.onPressIn && this.props.onPressIn(e); }, touchableHandleActivePressOut: function(e: PressEvent) { + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ if (!this._hideTimeout) { this._hideUnderlay(); } @@ -272,9 +302,15 @@ const TouchableHighlight = ((createReactClass({ }, touchableHandlePress: function(e: PressEvent) { + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ clearTimeout(this._hideTimeout); if (!Platform.isTV) { this._showUnderlay(); + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ this._hideTimeout = setTimeout( this._hideUnderlay, this.props.delayPressOut, @@ -308,6 +344,9 @@ const TouchableHighlight = ((createReactClass({ }, _showUnderlay: function() { + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ if (!this._isMounted || !this._hasPressHandler()) { return; } @@ -323,7 +362,13 @@ const TouchableHighlight = ((createReactClass({ }, _hideUnderlay: function() { + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ clearTimeout(this._hideTimeout); + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ this._hideTimeout = null; if (this.props.testOnly_pressed) { return; @@ -364,13 +409,31 @@ const TouchableHighlight = ((createReactClass({ isTVSelectable={true} tvParallaxProperties={this.props.tvParallaxProperties} hasTVPreferredFocus={this.props.hasTVPreferredFocus} + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder} onResponderTerminationRequest={ + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses + * an error found when Flow v0.89 was deployed. To see the error, + * delete this comment and run Flow. */ this.touchableHandleResponderTerminationRequest } + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ onResponderGrant={this.touchableHandleResponderGrant} + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ onResponderMove={this.touchableHandleResponderMove} + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ onResponderRelease={this.touchableHandleResponderRelease} + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ onResponderTerminate={this.touchableHandleResponderTerminate} nativeID={this.props.nativeID} testID={this.props.testID}> diff --git a/Libraries/Components/Touchable/TouchableNativeFeedback.android.js b/Libraries/Components/Touchable/TouchableNativeFeedback.android.js index 82031a4198aad8..16beec536b41d6 100644 --- a/Libraries/Components/Touchable/TouchableNativeFeedback.android.js +++ b/Libraries/Components/Touchable/TouchableNativeFeedback.android.js @@ -75,6 +75,9 @@ const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30}; const TouchableNativeFeedback = createReactClass({ displayName: 'TouchableNativeFeedback', propTypes: { + /* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment + * suppresses an error found when Flow v0.89 was deployed. To see the + * error, delete this comment and run Flow. */ ...TouchableWithoutFeedback.propTypes, /** @@ -107,7 +110,10 @@ const TouchableNativeFeedback = createReactClass({ * Creates an object that represents android theme's default background for * selectable elements (?android:attr/selectableItemBackground). */ - SelectableBackground: function() { + SelectableBackground: function(): { + type: 'ThemeAttrAndroid', + attribute: 'selectableItemBackground', + } { return {type: 'ThemeAttrAndroid', attribute: 'selectableItemBackground'}; }, /** @@ -115,7 +121,10 @@ const TouchableNativeFeedback = createReactClass({ * selectable elements (?android:attr/selectableItemBackgroundBorderless). * Available on android API level 21+. */ - SelectableBackgroundBorderless: function() { + SelectableBackgroundBorderless: function(): { + type: 'ThemeAttrAndroid', + attribute: 'selectableItemBackgroundBorderless', + } { return { type: 'ThemeAttrAndroid', attribute: 'selectableItemBackgroundBorderless', @@ -131,7 +140,14 @@ const TouchableNativeFeedback = createReactClass({ * @param color The ripple color * @param borderless If the ripple can render outside it's bounds */ - Ripple: function(color: string, borderless: boolean) { + Ripple: function( + color: string, + borderless: boolean, + ): { + type: 'RippleAndroid', + color: ?number, + borderless: boolean, + } { return { type: 'RippleAndroid', color: processColor(color), @@ -139,7 +155,7 @@ const TouchableNativeFeedback = createReactClass({ }; }, - canUseNativeForeground: function() { + canUseNativeForeground: function(): boolean { return Platform.OS === 'android' && Platform.Version >= 23; }, }, @@ -171,9 +187,18 @@ const TouchableNativeFeedback = createReactClass({ touchableHandleActivePressIn: function(e: PressEvent) { this.props.onPressIn && this.props.onPressIn(e); this._dispatchPressedStateChange(true); + /* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment + * suppresses an error found when Flow v0.89 was deployed. To see the + * error, delete this comment and run Flow. */ if (this.pressInLocation) { this._dispatchHotspotUpdate( + /* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment + * suppresses an error found when Flow v0.89 was deployed. To see the + * error, delete this comment and run Flow. */ this.pressInLocation.locationX, + /* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment + * suppresses an error found when Flow v0.89 was deployed. To see the + * error, delete this comment and run Flow. */ this.pressInLocation.locationY, ); } diff --git a/Libraries/Components/Touchable/TouchableOpacity.js b/Libraries/Components/Touchable/TouchableOpacity.js index 10a4e4a166c4b4..0451f8dfff1e7f 100644 --- a/Libraries/Components/Touchable/TouchableOpacity.js +++ b/Libraries/Components/Touchable/TouchableOpacity.js @@ -135,6 +135,9 @@ const TouchableOpacity = ((createReactClass({ mixins: [Touchable.Mixin.withoutDefaultFocusAndBlur, NativeMethodsMixin], propTypes: { + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ ...TouchableWithoutFeedback.propTypes, /** * Determines what the opacity of the wrapped view should be when touch is @@ -159,7 +162,13 @@ const TouchableOpacity = ((createReactClass({ getInitialState: function() { return { + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ ...this.touchableGetInitialState(), + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ anim: new Animated.Value(this._getChildStyleOpacityWithDefault()), }; }, @@ -257,6 +266,9 @@ const TouchableOpacity = ((createReactClass({ }, _opacityInactive: function(duration: number) { + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ this.setOpacityTo(this._getChildStyleOpacityWithDefault(), duration); }, @@ -281,13 +293,31 @@ const TouchableOpacity = ((createReactClass({ hasTVPreferredFocus={this.props.hasTVPreferredFocus} tvParallaxProperties={this.props.tvParallaxProperties} hitSlop={this.props.hitSlop} + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder} onResponderTerminationRequest={ + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses + * an error found when Flow v0.89 was deployed. To see the error, + * delete this comment and run Flow. */ this.touchableHandleResponderTerminationRequest } + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ onResponderGrant={this.touchableHandleResponderGrant} + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ onResponderMove={this.touchableHandleResponderMove} + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ onResponderRelease={this.touchableHandleResponderRelease} + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ onResponderTerminate={this.touchableHandleResponderTerminate}> {this.props.children} {Touchable.renderDebugView({ diff --git a/Libraries/Components/View/View.js b/Libraries/Components/View/View.js index 00d16a8bbf2c7b..3e9d7c10a1a7b6 100644 --- a/Libraries/Components/View/View.js +++ b/Libraries/Components/View/View.js @@ -47,7 +47,6 @@ if (__DEV__) { ); }; - // $FlowFixMe - TODO T29156721 `React.forwardRef` is not defined in Flow, yet. ViewToExport = React.forwardRef(View); ViewToExport.displayName = 'View'; } diff --git a/Libraries/Components/View/ViewNativeComponent.js b/Libraries/Components/View/ViewNativeComponent.js index 432040ad3c3a4c..0f7d1977b9e690 100644 --- a/Libraries/Components/View/ViewNativeComponent.js +++ b/Libraries/Components/View/ViewNativeComponent.js @@ -16,6 +16,9 @@ const requireNativeComponent = require('requireNativeComponent'); import type {ViewProps} from 'ViewPropTypes'; +/* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.89 was deployed. To see the error, delete this comment + * and run Flow. */ type ViewNativeComponentType = Class>; const NativeViewComponent = requireNativeComponent('RCTView'); diff --git a/Libraries/Image/Image.android.js b/Libraries/Image/Image.android.js index 70e6e0f40414a5..c915608d4c3232 100644 --- a/Libraries/Image/Image.android.js +++ b/Libraries/Image/Image.android.js @@ -258,7 +258,6 @@ let Image = ( ); }; -// $FlowFixMe - TODO T29156721 `React.forwardRef` is not defined in Flow, yet. Image = React.forwardRef(Image); /** @@ -266,6 +265,9 @@ Image = React.forwardRef(Image); * * See https://facebook.github.io/react-native/docs/image.html#getsize */ +/* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ Image.getSize = getSize; /** @@ -274,6 +276,9 @@ Image.getSize = getSize; * * See https://facebook.github.io/react-native/docs/image.html#prefetch */ +/* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ Image.prefetch = prefetch; /** @@ -281,6 +286,9 @@ Image.prefetch = prefetch; * * See https://facebook.github.io/react-native/docs/image.html#abortprefetch */ +/* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ Image.abortPrefetch = abortPrefetch; /** @@ -288,6 +296,9 @@ Image.abortPrefetch = abortPrefetch; * * See https://facebook.github.io/react-native/docs/image.html#querycache */ +/* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ Image.queryCache = queryCache; /** @@ -295,8 +306,14 @@ Image.queryCache = queryCache; * * See https://facebook.github.io/react-native/docs/image.html#resolveassetsource */ +/* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ Image.resolveAssetSource = resolveAssetSource; +/* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ Image.propTypes = ImageProps; const styles = StyleSheet.create({ @@ -305,4 +322,7 @@ const styles = StyleSheet.create({ }, }); +/* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ module.exports = (Image: Class); diff --git a/Libraries/Image/Image.ios.js b/Libraries/Image/Image.ios.js index a20fd0a1206da6..188d0ef13a1b18 100644 --- a/Libraries/Image/Image.ios.js +++ b/Libraries/Image/Image.ios.js @@ -122,7 +122,6 @@ let Image = ( ); }; -// $FlowFixMe - TODO T29156721 `React.forwardRef` is not defined in Flow, yet. Image = React.forwardRef(Image); /** @@ -130,6 +129,9 @@ Image = React.forwardRef(Image); * * See https://facebook.github.io/react-native/docs/image.html#getsize */ +/* $FlowFixMe(>=0.89.0 site=react_native_ios_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ Image.getSize = getSize; /** @@ -138,6 +140,9 @@ Image.getSize = getSize; * * See https://facebook.github.io/react-native/docs/image.html#prefetch */ +/* $FlowFixMe(>=0.89.0 site=react_native_ios_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ Image.prefetch = prefetch; /** @@ -145,6 +150,9 @@ Image.prefetch = prefetch; * * See https://facebook.github.io/react-native/docs/image.html#querycache */ +/* $FlowFixMe(>=0.89.0 site=react_native_ios_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ Image.queryCache = queryCache; /** @@ -152,8 +160,14 @@ Image.queryCache = queryCache; * * See https://facebook.github.io/react-native/docs/image.html#resolveassetsource */ +/* $FlowFixMe(>=0.89.0 site=react_native_ios_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ Image.resolveAssetSource = resolveAssetSource; +/* $FlowFixMe(>=0.89.0 site=react_native_ios_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ Image.propTypes = DeprecatedImagePropType; const styles = StyleSheet.create({ @@ -162,4 +176,7 @@ const styles = StyleSheet.create({ }, }); +/* $FlowFixMe(>=0.89.0 site=react_native_ios_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ module.exports = (Image: Class); diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index e8820eee33b3c7..f6a9c6e2ee7c6e 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -1732,6 +1732,9 @@ class CellRenderer extends React.Component< : inversionStyle; if (!CellRendererComponent) { return ( + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ {element} {itemSeparator} diff --git a/Libraries/Lists/VirtualizedSectionList.js b/Libraries/Lists/VirtualizedSectionList.js index 8ce7aebd5f6749..2e2256287fc604 100644 --- a/Libraries/Lists/VirtualizedSectionList.js +++ b/Libraries/Lists/VirtualizedSectionList.js @@ -505,6 +505,9 @@ class ItemWithSeparator extends React.Component< ); return leadingSeparator || separator ? ( + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete + * this comment and run Flow. */ {leadingSeparator} {element} diff --git a/Libraries/Text/Text.js b/Libraries/Text/Text.js index 35df7249cade56..5df2ca4dc1f148 100644 --- a/Libraries/Text/Text.js +++ b/Libraries/Text/Text.js @@ -277,11 +277,16 @@ const Text = ( ) => { return ; }; -// $FlowFixMe - TODO T29156721 `React.forwardRef` is not defined in Flow, yet. const TextToExport = React.forwardRef(Text); TextToExport.displayName = 'Text'; // TODO: Deprecate this. +/* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.89 was deployed. To see the error, delete this comment + * and run Flow. */ TextToExport.propTypes = DeprecatedTextPropTypes; +/* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.89 was deployed. To see the error, delete this comment + * and run Flow. */ module.exports = (TextToExport: Class>); diff --git a/Libraries/Utilities/__tests__/setAndForwardRef-test.js b/Libraries/Utilities/__tests__/setAndForwardRef-test.js index 33bbd288d91e71..411e31dd8ef4aa 100644 --- a/Libraries/Utilities/__tests__/setAndForwardRef-test.js +++ b/Libraries/Utilities/__tests__/setAndForwardRef-test.js @@ -56,7 +56,6 @@ describe('setAndForwardRef', () => { } } - // $FlowFixMe - TODO T29156721 `React.forwardRef` is not defined in Flow, yet. const TestComponentWithRef = React.forwardRef((props, ref) => ( )); @@ -86,6 +85,9 @@ describe('setAndForwardRef', () => { it('should forward refs (createRef-based)', () => { const createdRef = React.createRef(); + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.89 was deployed. To see the error, delete this + * comment and run Flow. */ ReactTestRenderer.create(); /* $FlowFixMe(>=0.87.0 site=react_native_fb) This comment suppresses an diff --git a/RNTester/js/ExampleTypes.js b/RNTester/js/ExampleTypes.js index 0bfe107c92b28b..aa5c84ebca738a 100644 --- a/RNTester/js/ExampleTypes.js +++ b/RNTester/js/ExampleTypes.js @@ -10,13 +10,13 @@ 'use strict'; -/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment - * suppresses an error when upgrading Flow's support for React. To see the - * error delete this comment and run Flow. */ import type React from 'react'; export type Example = { title: string, + /* $FlowFixMe(>=0.89.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.89 was deployed. To see the error, delete this comment + * and run Flow. */ render: () => ?React.Element, description?: string, platform?: string, diff --git a/package.json b/package.json index 1bd7c0d7bc6226..98e7055f2cd54a 100644 --- a/package.json +++ b/package.json @@ -214,8 +214,8 @@ "@reactions/component": "^2.0.2", "async": "^2.4.0", "babel-eslint": "9.0.0", - "detox": "9.0.4", "coveralls": "^3.0.2", + "detox": "9.0.4", "eslint": "5.1.0", "eslint-config-fb-strict": "22.1.0", "eslint-config-fbjs": "2.0.1", @@ -225,7 +225,7 @@ "eslint-plugin-prettier": "2.6.0", "eslint-plugin-react": "7.8.2", "eslint-plugin-react-native": "3.5.0", - "flow-bin": "^0.88.0", + "flow-bin": "^0.89.0", "jest": "24.0.0-alpha.6", "jest-junit": "5.2.0", "prettier": "1.13.6", diff --git a/template/_flowconfig b/template/_flowconfig index acd81ae0f74526..fd786d7756c619 100644 --- a/template/_flowconfig +++ b/template/_flowconfig @@ -67,4 +67,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError [version] -^0.88.0 +^0.89.0 diff --git a/yarn.lock b/yarn.lock index cffc8d2f3c2edc..32262d7e84f663 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2778,10 +2778,10 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.88.0: - version "0.88.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.88.0.tgz#e4c7bd93da2331f6ac1733fbe484b1b0c52eb548" - integrity sha512-SnUCuhHP0JZaXQ83w4iTthfTInAg8DIBZCo1xIqDhFmQ6XNEMYMwYhPoMQyELRrkbTpyCYmf4g93y0UQw0dibw== +flow-bin@^0.89.0: + version "0.89.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.89.0.tgz#6bd29c2af7e0f429797f820662f33749105c32fa" + integrity sha512-DkO4PsXYrl53V6G5+t5HbRMC5ajYUQej2LEGPUZ+j9okTb41Sn5j9vfxsCpXMEAslYnQoysHhYu4GUZsQX/DrQ== for-in@^1.0.1, for-in@^1.0.2: version "1.0.2"