Skip to content

Commit

Permalink
fix: use public instance in Fiber renderer and expose it from getInsp…
Browse files Browse the repository at this point in the history
…ectorDataForViewAtPoint (facebook#31068)

Summary:
React DevTools no longer operates with just Fibers, it now builds its
own Shadow Tree, which represents the tree on the Host (Fabric on
Native, DOM on Web).

We have to keep track of public instances for a select-to-inspect
feature. We've recently changed this logic in
facebook/react#30831, and looks like we've been
incorrectly getting a public instance for Fabric case.

Not only this, turns out that all `getInspectorData...` APIs are
returning Fibers, and not public instances. I have to expose it, so that
React DevTools can correctly identify the element, which was selected.

Changes for React Native are in
[D63421463](https://www.internalfb.com/diff/D63421463)

DiffTrain build for commit facebook/react@d66fa02.

Differential Revision: D63453667
  • Loading branch information
hoxyq authored and facebook-github-bot committed Sep 26, 2024
1 parent 94b7793 commit 5eb8685
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noformat
* @nolint
* @flow strict
* @generated SignedSource<<3eb929731c259569c7af3b6479e486fe>>
* @generated SignedSource<<b803401b6dd721b9caffdac1f8b6fd1c>>
*/

import type {
Expand Down Expand Up @@ -180,6 +180,7 @@ export type TouchedViewDataAtPoint = $ReadOnly<{
width: number,
height: number,
}>,
closestPublicInstance?: PublicInstance,
...InspectorData,
}>;

Expand Down

0 comments on commit 5eb8685

Please sign in to comment.