diff --git a/packages/react-native/Libraries/Interaction/PanResponder.js b/packages/react-native/Libraries/Interaction/PanResponder.js index e64011e7873..71bec342048 100644 --- a/packages/react-native/Libraries/Interaction/PanResponder.js +++ b/packages/react-native/Libraries/Interaction/PanResponder.js @@ -574,9 +574,6 @@ function clearInteractionHandle( } } -export type PanResponderInstance = $Call< - $PropertyType, - PanResponderConfig, ->; +export type PanResponderInstance = ReturnType<(typeof PanResponder)['create']>; export default PanResponder; diff --git a/packages/react-native/Libraries/Utilities/ReactNativeTestTools.js b/packages/react-native/Libraries/Utilities/ReactNativeTestTools.js index 86715750541..f36e735eb2a 100644 --- a/packages/react-native/Libraries/Utilities/ReactNativeTestTools.js +++ b/packages/react-native/Libraries/Utilities/ReactNativeTestTools.js @@ -28,7 +28,6 @@ const ReactTestRenderer = require('react-test-renderer'); const shallowRenderer = new ShallowRenderer(); export type ReactTestInstance = $PropertyType; export type Predicate = (node: ReactTestInstance) => boolean; -type $ReturnType = $Call<((...A) => Ret) => Ret, Fn>; /* $FlowFixMe[value-as-type] (>=0.125.1 site=react_native_fb) This comment * suppresses an error found when Flow v0.125.1 was deployed. To see the error, * delete this comment and run Flow. */ @@ -36,7 +35,7 @@ export type ReactTestRendererJSON = /* $FlowFixMe[prop-missing] (>=0.125.1 site=react_native_fb) This comment * suppresses an error found when Flow v0.125.1 was deployed. To see the error, * delete this comment and run Flow. */ - $ReturnType; + ReturnType; function byClickable(): Predicate { return withMessage( diff --git a/packages/react-native/Libraries/promiseRejectionTrackingOptions.js b/packages/react-native/Libraries/promiseRejectionTrackingOptions.js index a57f3666899..b951f612ecf 100644 --- a/packages/react-native/Libraries/promiseRejectionTrackingOptions.js +++ b/packages/react-native/Libraries/promiseRejectionTrackingOptions.js @@ -10,9 +10,7 @@ import typeof {enable} from 'promise/setimmediate/rejection-tracking'; -type ExtractOptionsType =

(((options?: ?P) => void)) => P; - -let rejectionTrackingOptions: $Call = { +let rejectionTrackingOptions: $NonMaybeType[0]> = { allRejections: true, onUnhandled: (id, rejection = {}) => { let message: string; diff --git a/packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js b/packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js index cb41b818280..37535f520a1 100644 --- a/packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js +++ b/packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js @@ -15,7 +15,10 @@ const {DynamicColorIOS, PlatformColor, StyleSheet, Text, View} = ReactNative; function PlatformColorsExample() { function createTable() { - let colors: Array<{color: $Call, label: string}> = []; + let colors: Array<{ + color: ReturnType, + label: string, + }> = []; if (Platform.OS === 'ios') { colors = [ // https://developer.apple.com/documentation/uikit/uicolor/ui_element_colors