From 1b4a0cd9f293ae28bde02abce62e345db7cd0911 Mon Sep 17 00:00:00 2001 From: "Alex Taylor (alta)" Date: Fri, 29 Mar 2024 14:24:01 -0700 Subject: [PATCH] Use hook syntax for builtin React hooks in xplat (1/2) (#43714) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43714 Migrate React builtin hooks to use the new React "hook" type. This diff converts all builtin hooks except for `useContext` which will be updated after the next flow release. Details: - Announcement: https://fb.workplace.com/groups/react.fyi/posts/7642294409114198 - Docs: https://www.internalfb.com/intern/wiki/Component_Syntax_Documentation/Hook_syntax_0/ - Support group: https://fb.workplace.com/groups/749069370011855 Changelog: [internal] Reviewed By: SamChou19815 Differential Revision: D55500989 fbshipit-source-id: 8a13898b1d2e851dfc2afed3b41e0f1a6332b6bd --- .../PlatformTest/RNTesterPlatformTestEventRecorder.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js b/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js index 72adba1e962..63eb574191f 100644 --- a/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js +++ b/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js @@ -107,8 +107,9 @@ class RNTesterPlatformTestEventRecorder { ): $ReadOnly<{[targetName: string]: ViewProps}> { // Yes this method exists as a class's prototype method but it will still only be used // in functional components - // eslint-disable-next-line react-hooks/rules-of-hooks - return useMemo(() => { + // prettier-ignore + // $FlowFixMe[react-rule-hook] + return useMemo(() => { // eslint-disable-line react-hooks/rules-of-hooks const result: {[targetName: string]: ViewProps} = {}; for (const targetName of targetNames) { const recordedEventHandler =