From 3cf313fce8a395e5661831459129488262a6dd0f Mon Sep 17 00:00:00 2001 From: Joe Mun Date: Thu, 5 Dec 2024 13:16:40 -0800 Subject: [PATCH] Patch Flow syntax failures --- .../Libraries/Animated/createAnimatedComponent.js | 7 +------ .../Libraries/Animated/nodes/AnimatedObject.js | 2 +- .../react-native/Libraries/vendor/emitter/EventEmitter.js | 2 +- .../src/private/animated/NativeAnimatedHelper.js | 6 +++--- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/packages/react-native/Libraries/Animated/createAnimatedComponent.js b/packages/react-native/Libraries/Animated/createAnimatedComponent.js index 8c9fbea9c57825..d78cad5c576f0a 100644 --- a/packages/react-native/Libraries/Animated/createAnimatedComponent.js +++ b/packages/react-native/Libraries/Animated/createAnimatedComponent.js @@ -17,12 +17,7 @@ import {useMemo} from 'react'; export type AnimatedProps = { // eslint-disable-next-line no-unused-vars - +[_K in keyof (Props & - $ReadOnly<{ - passthroughAnimatedPropExplicitValues?: React.ElementConfig< - typeof View, - >, - }>)]: any, + +[_K]: any, }; export type AnimatedComponentType< diff --git a/packages/react-native/Libraries/Animated/nodes/AnimatedObject.js b/packages/react-native/Libraries/Animated/nodes/AnimatedObject.js index 2f3ff765de60ff..850964c84ea595 100644 --- a/packages/react-native/Libraries/Animated/nodes/AnimatedObject.js +++ b/packages/react-native/Libraries/Animated/nodes/AnimatedObject.js @@ -21,7 +21,7 @@ const MAX_DEPTH = 5; /* $FlowIssue[incompatible-type-guard] - Flow does not know that the prototype and ReactElement checks preserve the type refinement of `value`. */ -function isPlainObject(value: mixed): value is $ReadOnly<{[string]: mixed}> { +function isPlainObject(value: mixed) { return ( value !== null && typeof value === 'object' && diff --git a/packages/react-native/Libraries/vendor/emitter/EventEmitter.js b/packages/react-native/Libraries/vendor/emitter/EventEmitter.js index 1087654ea57827..5beed1d4de3c3a 100644 --- a/packages/react-native/Libraries/vendor/emitter/EventEmitter.js +++ b/packages/react-native/Libraries/vendor/emitter/EventEmitter.js @@ -36,7 +36,7 @@ interface Registration { } type Registry = { - [K in keyof TEventToArgsMap]: Set>, + [K]: Set>, }; /** diff --git a/packages/react-native/src/private/animated/NativeAnimatedHelper.js b/packages/react-native/src/private/animated/NativeAnimatedHelper.js index fac57567b1e747..bff4b0f5b62d61 100644 --- a/packages/react-native/src/private/animated/NativeAnimatedHelper.js +++ b/packages/react-native/src/private/animated/NativeAnimatedHelper.js @@ -135,7 +135,7 @@ const API = { } : (tag, saveValueCallback) => { NativeOperations.getValue(tag, saveValueCallback); - }) as $NonMaybeType['getValue'], + }), setWaitingForIdentifier(id: string): void { waitingForQueuedOperations.add(id); @@ -216,7 +216,7 @@ const API = { if (Platform.OS === 'android') { NativeAnimatedModule?.finishOperationBatch?.(); } - }) as () => void, + }), createAnimatedNode(tag: number, config: AnimatedNodeConfig): void { NativeOperations.createAnimatedNode(tag, config); @@ -258,7 +258,7 @@ const API = { config, endCallback, ); - }) as $NonMaybeType['startAnimatingNode'], + }), stopAnimation(animationId: number) { NativeOperations.stopAnimation(animationId);