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

View File

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