Skip to content

Commit

Permalink
Prepare for removal of types in ReactNativeTypes
Browse files Browse the repository at this point in the history
Summary:
Changelog: [internal]

This just prepares for the removal of some types from `ReactNativeTypes`, and defines some types in `ReactNativePrivateInterface` that `ReactNativeTypes` expects to be defined after facebook/react#32446

Differential Revision: D69996009
  • Loading branch information
rubennorte authored and facebook-github-bot committed Feb 22, 2025
1 parent 0746853 commit 5521c68
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
* @flow strict-local
*/

import type {HostComponent, HostInstance} from '../..';
import type {HostInstance} from '../..';
import type {
InternalInstanceHandle,
Node,
} from '../Renderer/shims/ReactNativeTypes';
import type ReactFabricHostComponent from './ReactFabricPublicInstance/ReactFabricHostComponent';
import type {ElementRef, ElementType} from 'react';

import {
Expand Down Expand Up @@ -135,8 +134,8 @@ export function isProfilingRenderer(): boolean {
}

export function isChildPublicInstance(
parentInstance: ReactFabricHostComponent | HostComponent<empty>,
childInstance: ReactFabricHostComponent | HostComponent<empty>,
parentInstance: HostInstance,
childInstance: HostInstance,
): boolean {
return require('../Renderer/shims/ReactNative').default.isChildPublicInstance(
parentInstance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,19 @@ import typeof deepFreezeAndThrowOnMutationInDev from '../Utilities/deepFreezeAnd
import typeof deepDiffer from '../Utilities/differ/deepDiffer';
import typeof Platform from '../Utilities/Platform';

// Expose these types to the React renderer
export type {
HostInstance as PublicInstance,

// These types are only necessary for Paper
INativeMethods as LegacyPublicInstance,
MeasureOnSuccessCallback,
MeasureInWindowOnSuccessCallback,
MeasureLayoutOnSuccessCallback,
} from '../Types/HostInstance';

export type {PublicRootInstance} from '../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance';
export type PublicTextInstance = ReturnType<createPublicTextInstance>;

// flowlint unsafe-getters-setters:off
module.exports = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6967,8 +6967,8 @@ declare export function unstable_batchedUpdates<T>(
): void;
declare export function isProfilingRenderer(): boolean;
declare export function isChildPublicInstance(
parentInstance: ReactFabricHostComponent | HostComponent<empty>,
childInstance: ReactFabricHostComponent | HostComponent<empty>
parentInstance: HostInstance,
childInstance: HostInstance
): boolean;
declare export function getNodeFromInternalInstanceHandle(
internalInstanceHandle: InternalInstanceHandle
Expand Down

0 comments on commit 5521c68

Please sign in to comment.