Return lastNonHostInstance in getInspectorDataForInstance for devtools (#25441)

This commit is contained in:
Tianyu Yao 2022-10-07 15:43:02 -07:00 committed by GitHub
parent 5d60a0b840
commit 513417d695
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -112,6 +112,7 @@ if (__DEV__ || enableGetInspectorDataForInstanceInProduction) {
const selectedIndex = fiberHierarchy.indexOf(instance);
return {
closestInstance: instance,
hierarchy,
props,
selectedIndex,
@ -225,7 +226,6 @@ if (__DEV__) {
pointerY: locationY,
frame: {left: pageX, top: pageY, width, height},
touchedViewTag: nativeViewTag,
closestInstance,
});
},
);

View File

@ -138,6 +138,7 @@ type InspectorDataGetter = (
}>;
export type InspectorData = $ReadOnly<{
closestInstance?: mixed,
hierarchy: Array<{
name: ?string,
getInspectorData: InspectorDataGetter,
@ -150,7 +151,6 @@ export type InspectorData = $ReadOnly<{
export type TouchedViewDataAtPoint = $ReadOnly<{
pointerY: number,
touchedViewTag?: number,
closestInstance?: mixed,
frame: $ReadOnly<{
top: number,
left: number,