Skip to content

Commit

Permalink
'[skip ci] fix: pass closest public instance to React DevTools
Browse files Browse the repository at this point in the history
Summary:
# Changelog: [Internal]

Please see facebook/react#31068.

Synced changes for React Native - D63453667.

Differential Revision: D63421463
  • Loading branch information
hoxyq authored and facebook-github-bot committed Sep 26, 2024
1 parent 95964af commit 18d4469
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions packages/react-native/Libraries/Inspector/ReactDevToolsOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,15 @@ export default function ReactDevToolsOverlay({
x,
y,
viewData => {
const {touchedViewTag, closestInstance, frame} = viewData;
if (closestInstance != null || touchedViewTag != null) {
// We call `selectNode` for both non-fabric(viewTag) and fabric(instance),
// this makes sure it works for both architectures.
reactDevToolsAgent.selectNode(findNodeHandle(touchedViewTag));
if (closestInstance != null) {
reactDevToolsAgent.selectNode(closestInstance);
}
setInspected({
frame,
});
return true;
const {frame, closestPublicInstance} = viewData;

if (closestPublicInstance == null) {
return false;
}
return false;

reactDevToolsAgent.selectNode(closestPublicInstance);
setInspected({frame});
return true;
},
);
},
Expand Down

0 comments on commit 18d4469

Please sign in to comment.