mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3f88821167
commit
1b4a0cd9f2
+3
-2
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user