diff --git a/IntegrationTests/TimersTest.js b/IntegrationTests/TimersTest.js index 6a9924df366474..30473e3b8e752c 100644 --- a/IntegrationTests/TimersTest.js +++ b/IntegrationTests/TimersTest.js @@ -262,6 +262,7 @@ class TimersTest extends React.Component { this.clearInterval(this._interval); this._interval = null; } + // $FlowFixMe[method-unbinding] this.setState({count: 0}, this._nextTest); return; } diff --git a/Libraries/Animated/animations/TimingAnimation.js b/Libraries/Animated/animations/TimingAnimation.js index 17b7a975ab1e8b..7f239ce0102faf 100644 --- a/Libraries/Animated/animations/TimingAnimation.js +++ b/Libraries/Animated/animations/TimingAnimation.js @@ -48,6 +48,7 @@ let _easeInOut; function easeInOut() { if (!_easeInOut) { const Easing = require('../Easing'); + // $FlowFixMe[method-unbinding] _easeInOut = Easing.inOut(Easing.ease); } return _easeInOut; diff --git a/Libraries/BugReporting/BugReporting.js b/Libraries/BugReporting/BugReporting.js index ed79b952dc133d..d0f8dc2b18c73e 100644 --- a/Libraries/BugReporting/BugReporting.js +++ b/Libraries/BugReporting/BugReporting.js @@ -43,6 +43,7 @@ class BugReporting { if (!BugReporting._subscription) { BugReporting._subscription = RCTDeviceEventEmitter.addListener( 'collectBugExtraData', + // $FlowFixMe[method-unbinding] BugReporting.collectExtraData, null, ); @@ -52,6 +53,7 @@ class BugReporting { if (!BugReporting._redboxSubscription) { BugReporting._redboxSubscription = RCTDeviceEventEmitter.addListener( 'collectRedBoxExtraData', + // $FlowFixMe[method-unbinding] BugReporting.collectExtraData, null, ); diff --git a/Libraries/Components/Touchable/Touchable.js b/Libraries/Components/Touchable/Touchable.js index f59ba3ad4954ff..6622645cab6bca 100644 --- a/Libraries/Components/Touchable/Touchable.js +++ b/Libraries/Components/Touchable/Touchable.js @@ -418,6 +418,7 @@ const TouchableMixin = { * @param {SyntheticEvent} e Synthetic event from event system. * */ + // $FlowFixMe[signature-verification-failure] touchableHandleResponderGrant: function(e: PressEvent) { const dispatchID = e.currentTarget; // Since e is used in a callback invoked on another event loop @@ -459,6 +460,7 @@ const TouchableMixin = { /** * Place as callback for a DOM element's `onResponderRelease` event. */ + // $FlowFixMe[signature-verification-failure] touchableHandleResponderRelease: function(e: PressEvent) { this.pressInLocation = null; this._receiveSignal(Signals.RESPONDER_RELEASE, e); @@ -467,6 +469,7 @@ const TouchableMixin = { /** * Place as callback for a DOM element's `onResponderTerminate` event. */ + // $FlowFixMe[signature-verification-failure] touchableHandleResponderTerminate: function(e: PressEvent) { this.pressInLocation = null; this._receiveSignal(Signals.RESPONDER_TERMINATED, e); @@ -475,6 +478,7 @@ const TouchableMixin = { /** * Place as callback for a DOM element's `onResponderMove` event. */ + // $FlowFixMe[signature-verification-failure] touchableHandleResponderMove: function(e: PressEvent) { // Measurement may not have returned yet. if (!this.state.touchable.positionOnActivate) { @@ -560,6 +564,7 @@ const TouchableMixin = { * element that was blurred just prior to this. This can be overridden when * using `Touchable.Mixin.withoutDefaultFocusAndBlur`. */ + // $FlowFixMe[signature-verification-failure] touchableHandleFocus: function(e: Event) { this.props.onFocus && this.props.onFocus(e); }, @@ -572,6 +577,7 @@ const TouchableMixin = { * This can be overridden when using * `Touchable.Mixin.withoutDefaultFocusAndBlur`. */ + // $FlowFixMe[signature-verification-failure] touchableHandleBlur: function(e: Event) { this.props.onBlur && this.props.onBlur(e); }, @@ -665,6 +671,7 @@ const TouchableMixin = { } }, + // $FlowFixMe[signature-verification-failure] _handleQueryLayout: function( l: number, t: number, @@ -691,11 +698,13 @@ const TouchableMixin = { ); }, + // $FlowFixMe[signature-verification-failure] _handleDelay: function(e: PressEvent) { this.touchableDelayTimeout = null; this._receiveSignal(Signals.DELAY, e); }, + // $FlowFixMe[signature-verification-failure] _handleLongDelay: function(e: PressEvent) { this.longPressDelayTimeout = null; const curState = this.state.touchable.touchState; @@ -715,6 +724,7 @@ const TouchableMixin = { * @throws Error if invalid state transition or unrecognized signal. * @sideeffects */ + // $FlowFixMe[signature-verification-failure] _receiveSignal: function(signal: Signal, e: PressEvent) { const responderID = this.state.touchable.responderID; const curState = this.state.touchable.touchState; @@ -766,6 +776,7 @@ const TouchableMixin = { ); }, + // $FlowFixMe[signature-verification-failure] _savePressInLocation: function(e: PressEvent) { const touch = extractSingleTouch(e.nativeEvent); const pageX = touch && touch.pageX; @@ -797,6 +808,7 @@ const TouchableMixin = { * @param {Event} e Native event. * @sideeffects */ + // $FlowFixMe[signature-verification-failure] _performSideEffectsForTransition: function( curState: State, nextState: State, @@ -858,11 +870,13 @@ const TouchableMixin = { this.touchableDelayTimeout = null; }, + // $FlowFixMe[signature-verification-failure] _startHighlight: function(e: PressEvent) { this._savePressInLocation(e); this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e); }, + // $FlowFixMe[signature-verification-failure] _endHighlight: function(e: PressEvent) { if (this.touchableHandleActivePressOut) { if ( diff --git a/Libraries/Components/Touchable/TouchableOpacity.js b/Libraries/Components/Touchable/TouchableOpacity.js index fc6da22f852c41..01b59674ad380a 100644 --- a/Libraries/Components/Touchable/TouchableOpacity.js +++ b/Libraries/Components/Touchable/TouchableOpacity.js @@ -188,6 +188,7 @@ class TouchableOpacity extends React.Component { Animated.timing(this.state.anim, { toValue, duration, + // $FlowFixMe[method-unbinding] easing: Easing.inOut(Easing.quad), useNativeDriver: true, }).start(); diff --git a/Libraries/Interaction/InteractionMixin.js b/Libraries/Interaction/InteractionMixin.js index 6c8356f3ec567b..e7c80a90846ec2 100644 --- a/Libraries/Interaction/InteractionMixin.js +++ b/Libraries/Interaction/InteractionMixin.js @@ -33,6 +33,7 @@ const InteractionMixin = { return handle; }, + // $FlowFixMe[signature-verification-failure] clearInteractionHandle: function(clearHandle: number): void { InteractionManager.clearInteractionHandle(clearHandle); this._interactionMixinHandles = this._interactionMixinHandles.filter( diff --git a/Libraries/Lists/VirtualizedSectionList.js b/Libraries/Lists/VirtualizedSectionList.js index 69e14fe1512288..977fa3a0d7853c 100644 --- a/Libraries/Lists/VirtualizedSectionList.js +++ b/Libraries/Lists/VirtualizedSectionList.js @@ -605,6 +605,7 @@ function ItemWithSeparator(props: ItemWithSeparatorProps): React.Node { /* $FlowFixMe[class-object-subtyping] added when improving typing for this * parameters */ +// $FlowFixMe[method-unbinding] module.exports = (VirtualizedSectionList: React.AbstractComponent< React.ElementConfig, $ReadOnly<{ diff --git a/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js b/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js index a8db3ae25be13f..fd9ec23926b50b 100644 --- a/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +++ b/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js @@ -36,6 +36,7 @@ function LogBoxInspectorSourceMapStatus(props: Props): React.Node { const animation = Animated.loop( Animated.timing(animated, { duration: 2000, + // $FlowFixMe[method-unbinding] easing: Easing.linear, toValue: 1, useNativeDriver: true, diff --git a/Libraries/Storage/AsyncStorage.js b/Libraries/Storage/AsyncStorage.js index 15080dbc42c3e4..057f39d4ee78e9 100644 --- a/Libraries/Storage/AsyncStorage.js +++ b/Libraries/Storage/AsyncStorage.js @@ -237,6 +237,7 @@ const AsyncStorage = { * * See https://reactnative.dev/docs/asyncstorage.html#multiget */ + // $FlowFixMe[signature-verification-failure] multiGet: function( keys: Array, callback?: ?(errors: ?Array, result: ?Array>) => void, diff --git a/Libraries/YellowBox/YellowBoxDeprecated.js b/Libraries/YellowBox/YellowBoxDeprecated.js index 46ba16eeeda5a3..5ff6217c928962 100644 --- a/Libraries/YellowBox/YellowBoxDeprecated.js +++ b/Libraries/YellowBox/YellowBoxDeprecated.js @@ -67,6 +67,7 @@ if (__DEV__) { }; } +// $FlowFixMe[method-unbinding] module.exports = (YellowBox: Class> & { ignoreWarnings($ReadOnlyArray): void, install(): void, diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleJniCpp.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleJniCpp.js index 53c0f702f48cd0..60b7274b786846 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleJniCpp.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleJniCpp.js @@ -421,6 +421,7 @@ module.exports = { }) .join('\n'); + // $FlowFixMe[missing-type-arg] const moduleLookups = Object.keys(nativeModules) .filter(hasteModuleName => { const module = nativeModules[hasteModuleName]; diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/StructCollector.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/StructCollector.js index a4377a64e4e40e..e92bcb66eb3da8 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/StructCollector.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/StructCollector.js @@ -144,6 +144,7 @@ class StructCollector { resolveAlias: AliasResolver, objectTypeAnnotation: NativeModuleObjectTypeAnnotation, ): void { + // $FlowFixMe[missing-type-arg] const properties = objectTypeAnnotation.properties.map< $ReadOnly<{ name: string, diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/header/serializeRegularStruct.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/header/serializeRegularStruct.js index 90b4c7f114c10a..fdcb2ab310665f 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/header/serializeRegularStruct.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/header/serializeRegularStruct.js @@ -223,6 +223,7 @@ function serializeRegularStruct( .join('\n '), }); + // $FlowFixMe[missing-type-arg] const methods = struct.properties .map(property => { const {typeAnnotation, optional, name: propName} = property; diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/serializeMethod.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/serializeMethod.js index 4d948b6f6ece30..6f5c742a346be7 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/serializeMethod.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleObjCpp/serializeMethod.js @@ -144,6 +144,7 @@ function serializeMethod( /** * Build ObjC Selector */ + // $FlowFixMe[missing-type-arg] const selector = methodParams .map(({paramName}) => paramName) .reduce(($selector, paramName, i) => { @@ -422,6 +423,7 @@ function serializeConstantsProtocolMethods( const returnObjCType = `facebook::react::ModuleConstants`; + // $FlowFixMe[missing-type-arg] return ['constantsToExport', 'getConstants'].map( methodName => { const protocolMethod = ProtocolMethodTemplate({ diff --git a/packages/react-native-codegen/src/parsers/flow/modules/index.js b/packages/react-native-codegen/src/parsers/flow/modules/index.js index 1d8b7b55f87c30..ffbb50af398771 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/index.js +++ b/packages/react-native-codegen/src/parsers/flow/modules/index.js @@ -219,6 +219,7 @@ function translateTypeAnnotation( case 'ObjectTypeAnnotation': { const objectTypeAnnotation = { type: 'ObjectTypeAnnotation', + // $FlowFixMe[missing-type-arg] properties: (typeAnnotation.properties: Array<$FlowFixMe>) .map>>( property => { @@ -669,6 +670,7 @@ function buildModuleSchema( } }); + // $FlowFixMe[missing-type-arg] return (moduleSpec.body.properties: $ReadOnlyArray<$FlowFixMe>) .filter(property => property.type === 'ObjectTypeProperty') .map { Alert.prompt('Type a value', null, this.saveResponse)}> prompt with title & callback @@ -104,6 +105,7 @@ class PromptOptions extends React.Component { 'Type a value', null, // $FlowFixMe[method-unbinding] added when improving typing for this parameters + // $FlowFixMe[incompatible-call] this.saveResponse, undefined, 'Default value', diff --git a/packages/rn-tester/js/examples/Animated/ComposeAnimationsWithEasingExample.js b/packages/rn-tester/js/examples/Animated/ComposeAnimationsWithEasingExample.js index 4009d1d17f1e1b..6ce07985c715a2 100644 --- a/packages/rn-tester/js/examples/Animated/ComposeAnimationsWithEasingExample.js +++ b/packages/rn-tester/js/examples/Animated/ComposeAnimationsWithEasingExample.js @@ -30,6 +30,8 @@ export default ({ description: ('Sequence, parallel, delay, and ' + 'stagger with different easing functions.': string), render: function(): React.Node { + // $FlowFixMe[incompatible-use] + // $FlowFixMe[incompatible-type] this.anims = this.anims || [1, 2, 3].map(() => new Animated.Value(0)); return ( @@ -38,12 +40,15 @@ export default ({ const timing = Animated.timing; Animated.sequence([ // One after the other + // $FlowFixMe[incompatible-use] timing(this.anims[0], { toValue: 200, + // $FlowFixMe[method-unbinding] easing: Easing.linear, useNativeDriver: false, }), Animated.delay(400), // Use with sequence + // $FlowFixMe[incompatible-use] timing(this.anims[0], { toValue: 0, @@ -55,6 +60,7 @@ export default ({ Animated.delay(400), Animated.stagger( 200, + // $FlowFixMe[incompatible-use] this.anims .map(anim => timing(anim, { @@ -63,6 +69,7 @@ export default ({ }), ) .concat( + // $FlowFixMe[incompatible-use] this.anims.map(anim => timing(anim, { toValue: 0, @@ -74,12 +81,15 @@ export default ({ Animated.delay(400), Animated.parallel( [ + // $FlowFixMe[method-unbinding] Easing.inOut(Easing.quad), // Symmetric Easing.back(1.5), // Goes backwards first Easing.ease, // Default bezier ].map((easing, ii) => + // $FlowFixMe[incompatible-use] timing(this.anims[ii], { toValue: 320, + // $FlowFixMe[method-unbinding] easing, duration: 3000, useNativeDriver: false, @@ -89,11 +99,13 @@ export default ({ Animated.delay(400), Animated.stagger( 200, + // $FlowFixMe[incompatible-use] this.anims.map(anim => timing(anim, { toValue: 0, // Like a ball + // $FlowFixMe[method-unbinding] easing: Easing.bounce, duration: 2000, @@ -111,6 +123,7 @@ export default ({ style={[ styles.content, { + // $FlowFixMe[incompatible-use] left: this.anims[ii], }, ]}> diff --git a/packages/rn-tester/js/examples/Animated/RotatingImagesExample.js b/packages/rn-tester/js/examples/Animated/RotatingImagesExample.js index 58ae608c873061..b14d346be4771a 100644 --- a/packages/rn-tester/js/examples/Animated/RotatingImagesExample.js +++ b/packages/rn-tester/js/examples/Animated/RotatingImagesExample.js @@ -21,11 +21,14 @@ const styles = StyleSheet.create({ }); function RotatingImagesExample(): React.Node { + // $FlowFixMe[incompatible-use] + // $FlowFixMe[incompatible-type] this.anim = this.anim || new Animated.Value(0); return ( { + // $FlowFixMe[incompatible-use] Animated.spring(this.anim, { // Returns to the start toValue: 0, @@ -57,12 +60,14 @@ function RotatingImagesExample(): React.Node { }), }, { + // $FlowFixMe[incompatible-use] translateX: this.anim.interpolate({ inputRange: [0, 1], outputRange: [0, 100], }), }, { + // $FlowFixMe[incompatible-use] rotate: this.anim.interpolate({ inputRange: [0, 1], outputRange: [ diff --git a/packages/rn-tester/js/examples/Animated/TransformBounceExample.js b/packages/rn-tester/js/examples/Animated/TransformBounceExample.js index 40527eae5a7676..a8638b7d544974 100644 --- a/packages/rn-tester/js/examples/Animated/TransformBounceExample.js +++ b/packages/rn-tester/js/examples/Animated/TransformBounceExample.js @@ -33,11 +33,14 @@ export default ({ 'an interpolation to convert the value into the ' + 'right range and units.': string), render: function(): React.Node { + // $FlowFixMe[incompatible-use] + // $FlowFixMe[incompatible-type] this.anim = this.anim || new Animated.Value(0); return ( { + // $FlowFixMe[incompatible-use] Animated.spring(this.anim, { // Returns to the start toValue: 0, @@ -69,12 +72,14 @@ export default ({ }), }, { + // $FlowFixMe[incompatible-use] translateX: this.anim.interpolate({ inputRange: [0, 1], outputRange: [0, 500], }), }, { + // $FlowFixMe[incompatible-use] rotate: this.anim.interpolate({ inputRange: [0, 1], outputRange: [ diff --git a/packages/rn-tester/js/examples/ScrollView/ScrollViewAnimatedExample.js b/packages/rn-tester/js/examples/ScrollView/ScrollViewAnimatedExample.js index 3ed2fd8dfde43f..bfd4b77183f462 100644 --- a/packages/rn-tester/js/examples/ScrollView/ScrollViewAnimatedExample.js +++ b/packages/rn-tester/js/examples/ScrollView/ScrollViewAnimatedExample.js @@ -31,6 +31,7 @@ class ScrollViewAnimatedExample extends Component<{...}> { Animated.timing(this._scrollViewPos, { toValue: 100, duration: 10000, + // $FlowFixMe[method-unbinding] easing: Easing.linear, useNativeDriver: true, }).start();