@samitouri / QOS-React-2 / commits / 513417d695

Return lastNonHostInstance in getInspectorDataForInstance for devtools (#25441)

Tianyu Yao committed Oct 7, 2022 at 15:43 UTC 513417d6951fa3ff5729302b7990b84604b11afa
2 files changed +2 -2
packages/react-native-renderer/src/ReactNativeFiberInspector.js
+1 -1
@@ -112,6 +112,7 @@ if (__DEV__ || enableGetInspectorDataForInstanceInProduction) {
112 const selectedIndex = fiberHierarchy.indexOf(instance);
113
114 return {
115 + closestInstance: instance,
116 hierarchy,
117 props,
118 selectedIndex,
@@ -225,7 +226,6 @@ if (__DEV__) {
226 pointerY: locationY,
227 frame: {left: pageX, top: pageY, width, height},
228 touchedViewTag: nativeViewTag,
228 - closestInstance,
229 });
230 },
231 );
packages/react-native-renderer/src/ReactNativeTypes.js
+1 -1
@@ -138,6 +138,7 @@ type InspectorDataGetter = (
138 }>;
139
140 export type InspectorData = $ReadOnly<{
141 + closestInstance?: mixed,
142 hierarchy: Array<{
143 name: ?string,
144 getInspectorData: InspectorDataGetter,
@@ -150,7 +151,6 @@ export type InspectorData = $ReadOnly<{
151 export type TouchedViewDataAtPoint = $ReadOnly<{
152 pointerY: number,
153 touchedViewTag?: number,
153 - closestInstance?: mixed,
154 frame: $ReadOnly<{
155 top: number,
156 left: number,