File tree 2 files changed +12
-2
lines changed
packages/react-native-renderer/src
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 8
8
*/
9
9
10
10
import type { Node , HostComponent } from './ReactNativeTypes' ;
11
- import type { PublicInstance as FabricPublicInstance } from './ReactFiberConfigFabric' ;
12
- import type { PublicInstance as PaperPublicInstance } from './ReactFiberConfigNative' ;
13
11
import type { ElementRef , ElementType } from 'react' ;
14
12
15
13
// Modules provided by RN:
@@ -225,6 +223,11 @@ export function getNodeFromInternalInstanceHandle(
225
223
) ;
226
224
}
227
225
226
+ // Should have been PublicInstance from ReactFiberConfigFabric
227
+ type FabricPublicInstance = mixed ;
228
+ // Should have been PublicInstance from ReactFiberConfigNative
229
+ type PaperPublicInstance = HostComponent < mixed > ;
230
+
228
231
// Remove this once Paper is no longer supported and DOM Node API are enabled by default in RN.
229
232
export function isChildPublicInstance (
230
233
parentInstance : FabricPublicInstance | PaperPublicInstance ,
@@ -251,8 +254,10 @@ export function isChildPublicInstance(
251
254
}
252
255
253
256
const parentInternalInstanceHandle =
257
+ // $FlowExpectedError[incompatible-call] Type for parentInstance should have been PublicInstance from ReactFiberConfigFabric.
254
258
getInternalInstanceHandleFromPublicInstance ( parentInstance ) ;
255
259
const childInternalInstanceHandle =
260
+ // $FlowExpectedError[incompatible-call] Type for childInstance should have been PublicInstance from ReactFiberConfigFabric.
256
261
getInternalInstanceHandleFromPublicInstance ( childInstance ) ;
257
262
258
263
// Fabric
Original file line number Diff line number Diff line change @@ -191,6 +191,10 @@ export type ReactNativeType = {
191
191
findNodeHandle < TElementType : ElementType > (
192
192
componentOrHandle: ?(ElementRef< TElementType > | number),
193
193
): ?number,
194
+ isChildPublicInstance(
195
+ parent: PublicInstance | HostComponent< mixed > ,
196
+ child: PublicInstance | HostComponent< mixed > ,
197
+ ): boolean,
194
198
dispatchCommand(
195
199
handle: ElementRef< HostComponent < mixed > > ,
196
200
command : string ,
@@ -229,6 +233,7 @@ export type ReactFabricType = {
229
233
command : string ,
230
234
args : Array < mixed > ,
231
235
) : void ,
236
+ isChildPublicInstance ( parent : PublicInstance , child : PublicInstance ) : boolean ,
232
237
sendAccessibilityEvent (
233
238
handle : ElementRef < HostComponent < mixed >> ,
234
239
eventType : string ,
You can’t perform that action at this time.
0 commit comments