From a80baac58e9f2fc62829ab76b929f5c8b21c05a5 Mon Sep 17 00:00:00 2001 From: "hoxyq (Meta Employee)" Date: Wed, 11 Dec 2024 22:47:38 -0800 Subject: [PATCH] Remove comment syntax from ReactNativeTypes (#31457) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: # Summary I'm working to get the main `react-native` package parsable by modern Flow tooling (both `flow-bundler`, `flow-api-translator`). This diff trivially removes some redundant Flow comment syntax in `ReactNativeTypes.js`, which fixes parsing under these newer tools. ## How did you test this change? Files were pasted into `react-native-github` under fbsource, where Flow validates ✅. DiffTrain build for [92b62f500c3fca44a9dc9ead936ef3bf19481f02](https://github.com/facebook/react/commit/92b62f500c3fca44a9dc9ead936ef3bf19481f02) Reviewed By: huntie Differential Revision: D67100354 Pulled By: hoxyq fbshipit-source-id: 575e4bd8ceefad15576273920a263ae89d027cad --- .../Libraries/Renderer/shims/ReactNativeTypes.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js b/packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js index 26ab3007d020bf..85d273893178b8 100644 --- a/packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js +++ b/packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js @@ -7,7 +7,7 @@ * @noformat * @nolint * @flow strict - * @generated SignedSource<<9cf3e28d6ca0299bc0bb5caa75b19556>> + * @generated SignedSource<> */ import type {ElementRef, ElementType, MixedElement} from 'react'; @@ -133,9 +133,10 @@ declare const ensureNativeMethodsAreSynced: NativeMethods; (ensureNativeMethodsAreSynced: INativeMethods); export type HostInstance = NativeMethods; -/*:: -export type HostComponent = component(ref: React$RefSetter, ...Config); -*/ +export type HostComponent = component( + ref: React$RefSetter, + ...Config +); type InspectorDataProps = $ReadOnly<{ [propName: string]: string, @@ -206,9 +207,7 @@ export type ReactNativeType = { componentOrHandle: ?(ElementRef | number), ): ?number, isChildPublicInstance( - // eslint-disable-next-line no-undef parent: PublicInstance | HostComponent, - // eslint-disable-next-line no-undef child: PublicInstance | HostComponent, ): boolean, dispatchCommand(