Skip to content

Commit

Permalink
Return lastNonHostInstance in getInspectorDataForInstance for devtools (
Browse files Browse the repository at this point in the history
  • Loading branch information
tyao1 authored Oct 7, 2022
1 parent 5d60a0b commit 513417d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ if (__DEV__ || enableGetInspectorDataForInstanceInProduction) {
const selectedIndex = fiberHierarchy.indexOf(instance);

return {
closestInstance: instance,
hierarchy,
props,
selectedIndex,
Expand Down Expand Up @@ -225,7 +226,6 @@ if (__DEV__) {
pointerY: locationY,
frame: {left: pageX, top: pageY, width, height},
touchedViewTag: nativeViewTag,
closestInstance,
});
},
);
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-renderer/src/ReactNativeTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ type InspectorDataGetter = (
}>;

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

0 comments on commit 513417d

Please sign in to comment.