Skip to content

Commit 616a907

Browse files
hoxyqfacebook-github-bot
authored andcommitted
fix: add isChildPublicInstance to ReactNativeTypes (#27788) (#41807)
Summary: Pull Request resolved: #41807 Changelog: [Internal] Follow-up on facebook/react#27783. React Native is actually using `ReactNativeTypes`, which are synced from this repo. In order to make `isChildPublicInstance` visible for renderers inside React Native repository, we need to list it in `ReactNativeTypes`. Because of current circular dependency between React Native and React, it is impossible to actually type it properly: - Can't import any types in `ReactNativeTypes` from local files, because it will break React Native, once synced. - Implementations can't use real types in their definitions, because it will break these checks: https://github.com/facebook/react/blob/223db40d5a04dc3311f963f5296675f7f43139e8/packages/react-native-renderer/fabric.js#L12-L13 https://github.com/facebook/react/blob/223db40d5a04dc3311f963f5296675f7f43139e8/packages/react-native-renderer/index.js#L12-L14 DiffTrain build for commit facebook/react@c29ca23. Test Plan: Sandcastle tests Reviewed By: kassens Differential Revision: D51849040 Pulled By: hoxyq fbshipit-source-id: f75593e44c114289ad4c6fb8b4b37c4c5fd6d3d4
1 parent 73d0cf5 commit 616a907

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noformat
88
* @flow strict
99
* @nolint
10-
* @generated SignedSource<<1836a1b6639552dce12199ef2c85f63d>>
10+
* @generated SignedSource<<30640e7dd83e22e14db1648ca63f4316>>
1111
*/
1212

1313
import type {ElementRef, ElementType, Element, AbstractComponent} from 'react';
@@ -193,6 +193,10 @@ export type ReactNativeType = {
193193
findNodeHandle<TElementType: ElementType>(
194194
componentOrHandle: ?(ElementRef<TElementType> | number),
195195
): ?number,
196+
isChildPublicInstance(
197+
parent: PublicInstance | HostComponent<mixed>,
198+
child: PublicInstance | HostComponent<mixed>,
199+
): boolean,
196200
dispatchCommand(
197201
handle: ElementRef<HostComponent<mixed>>,
198202
command: string,
@@ -231,6 +235,7 @@ export type ReactFabricType = {
231235
command: string,
232236
args: Array<mixed>,
233237
): void,
238+
isChildPublicInstance(parent: PublicInstance, child: PublicInstance): boolean,
234239
sendAccessibilityEvent(
235240
handle: ElementRef<HostComponent<mixed>>,
236241
eventType: string,

0 commit comments

Comments
 (0)