diff --git a/packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js b/packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js index 3149eee6c41..eeebe41705f 100644 --- a/packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js +++ b/packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js @@ -7,25 +7,21 @@ * @noformat * @nolint * @flow strict - * @generated SignedSource<<2264e9839602043a41f1e13913b43b0f>> + * @generated SignedSource<<4216c04f5a8c40a833b0146588fab5fa>> */ import type { - Component as ReactComponent, - ElementRef, - ElementType, - MixedElement, -} from 'react'; -import type { + // $FlowFixMe[nonstrict-import] TODO(@rubennorte) + HostInstance as PublicInstance, // $FlowFixMe[nonstrict-import] TODO(@rubennorte) MeasureOnSuccessCallback, // $FlowFixMe[nonstrict-import] TODO(@rubennorte) - PublicInstance, - // $FlowFixMe[nonstrict-import] TODO(@rubennorte) PublicRootInstance, // $FlowFixMe[nonstrict-import] TODO(@rubennorte) PublicTextInstance, -} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface'; +} from 'react-native'; + +import * as React from 'react'; export type AttributeType = | true @@ -97,8 +93,8 @@ type InspectorDataProps = $ReadOnly<{ }>; type InspectorDataGetter = ( - ( - componentOrHandle: ElementRef | number, + ( + componentOrHandle: React.ElementRef | number, ) => ?number, ) => $ReadOnly<{ measure: (callback: MeasureOnSuccessCallback) => void, @@ -141,7 +137,7 @@ export type RenderRootOptions = { +componentStack?: ?string, // $FlowFixMe[unclear-type] unknown props and state. // $FlowFixMe[value-as-type] Component in react repo is any-typed, but it will be well typed externally. - +errorBoundary?: ?ReactComponent, + +errorBoundary?: ?React.Component, }, ) => void, onRecoverableError?: ( @@ -155,11 +151,11 @@ export type RenderRootOptions = { * Provide minimal Flow typing for the high-level RN API and call it a day. */ export type ReactNativeType = { - findHostInstance_DEPRECATED( - componentOrHandle: ?(ElementRef | number), + findHostInstance_DEPRECATED( + componentOrHandle: ?(React.ElementRef | number), ): ?PublicInstance, - findNodeHandle( - componentOrHandle: ?(ElementRef | number), + findNodeHandle( + componentOrHandle: ?(React.ElementRef | number), ): ?number, isChildPublicInstance(parent: PublicInstance, child: PublicInstance): boolean, dispatchCommand( @@ -169,11 +165,11 @@ export type ReactNativeType = { ): void, sendAccessibilityEvent(handle: PublicInstance, eventType: string): void, render( - element: MixedElement, + element: React.MixedElement, containerTag: number, callback: ?() => void, options: ?RenderRootOptions, - ): ?ElementRef, + ): ?React.ElementRef, unmountComponentAtNode(containerTag: number): void, unmountComponentAtNodeAndRemoveContainer(containerTag: number): void, +unstable_batchedUpdates: (fn: (T) => void, bookkeeping: T) => void, @@ -184,11 +180,11 @@ export opaque type Node = mixed; export opaque type InternalInstanceHandle = mixed; export type ReactFabricType = { - findHostInstance_DEPRECATED( - componentOrHandle: ?(ElementRef | number), + findHostInstance_DEPRECATED( + componentOrHandle: ?(React.ElementRef | number), ): ?PublicInstance, - findNodeHandle( - componentOrHandle: ?(ElementRef | number), + findNodeHandle( + componentOrHandle: ?(React.ElementRef | number), ): ?number, dispatchCommand( handle: PublicInstance, @@ -198,12 +194,12 @@ export type ReactFabricType = { isChildPublicInstance(parent: PublicInstance, child: PublicInstance): boolean, sendAccessibilityEvent(handle: PublicInstance, eventType: string): void, render( - element: MixedElement, + element: React.MixedElement, containerTag: number, callback: ?() => void, concurrentRoot: ?boolean, options: ?RenderRootOptions, - ): ?ElementRef, + ): ?React.ElementRef, unmountComponentAtNode(containerTag: number): void, getNodeFromInternalInstanceHandle( internalInstanceHandle: InternalInstanceHandle,