From 7000b9b76cb5688eb4257391e054bf23195a2559 Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Wed, 11 Dec 2024 14:16:58 -0800 Subject: [PATCH] Add annotations and casts to fix future flow error (#48219) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48219 Changelog: [internal] Reviewed By: panagosg7 Differential Revision: D67099060 fbshipit-source-id: fbb975d6194b071aa8f30dcd2b8f7f40130d31fb --- .../PlatformTest/RNTesterPlatformTestEventRecorder.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js b/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js index 01dd7d8f898450..d790c250acedc2 100644 --- a/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js +++ b/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js @@ -119,15 +119,14 @@ class RNTesterPlatformTestEventRecorder { callback && callback(event, eventType, targetName), ); const eventListenerProps = this.relevantEvents.reduce( - (acc, eventName) => { + (acc: ViewProps, eventName) => { const eventPropName = 'on' + eventName[0].toUpperCase() + eventName.slice(1); return { ...acc, - // $FlowFixMe[missing-local-annot] - [eventPropName]: e => { + [eventPropName]: (e => { recordedEventHandler(e, eventName); - }, + }) as $FlowFixMe, }; }, {},