Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38104

With the introduction of [new utility types](https://flow.org/en/docs/types/utilities/#toc-return-type) in Flow, these $Call are no longer needed

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D47078502

fbshipit-source-id: 7fc5f6aa08052b8de8e3f0a45ce2d7a24cb4e1b5
This commit is contained in:
Sam Zhou 2023-06-28 07:18:53 -07:00 коммит произвёл Facebook GitHub Bot
Родитель b01c7b4aa5
Коммит 605db4427c
4 изменённых файлов: 7 добавлений и 10 удалений

Просмотреть файл

@ -574,9 +574,6 @@ function clearInteractionHandle(
}
}
export type PanResponderInstance = $Call<
$PropertyType<typeof PanResponder, 'create'>,
PanResponderConfig,
>;
export type PanResponderInstance = ReturnType<(typeof PanResponder)['create']>;
export default PanResponder;

Просмотреть файл

@ -28,7 +28,6 @@ const ReactTestRenderer = require('react-test-renderer');
const shallowRenderer = new ShallowRenderer();
export type ReactTestInstance = $PropertyType<ReactTestRendererType, 'root'>;
export type Predicate = (node: ReactTestInstance) => boolean;
type $ReturnType<Fn> = $Call<<Ret, A>((...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<ReactTestRenderer.create.toJSON>;
ReturnType<ReactTestRenderer.create.toJSON>;
function byClickable(): Predicate {
return withMessage(

Просмотреть файл

@ -10,9 +10,7 @@
import typeof {enable} from 'promise/setimmediate/rejection-tracking';
type ExtractOptionsType = <P>(((options?: ?P) => void)) => P;
let rejectionTrackingOptions: $Call<ExtractOptionsType, enable> = {
let rejectionTrackingOptions: $NonMaybeType<Parameters<enable>[0]> = {
allRejections: true,
onUnhandled: (id, rejection = {}) => {
let message: string;

Просмотреть файл

@ -15,7 +15,10 @@ const {DynamicColorIOS, PlatformColor, StyleSheet, Text, View} = ReactNative;
function PlatformColorsExample() {
function createTable() {
let colors: Array<{color: $Call<typeof PlatformColor>, label: string}> = [];
let colors: Array<{
color: ReturnType<typeof PlatformColor>,
label: string,
}> = [];
if (Platform.OS === 'ios') {
colors = [
// https://developer.apple.com/documentation/uikit/uicolor/ui_element_colors