Remove dependency on internal data structure

Summary:
See context for this change in https://github.com/facebook/react-devtools/pull/770.
We'll later stop exposing `instance` (because it is a Fiber and is private to React).
Closes https://github.com/facebook/react-native/pull/14290

Reviewed By: trueadm

Differential Revision: D5164997

Pulled By: gaearon

fbshipit-source-id: cda479dd8a18773f01319f6b005e832e8e61387a
This commit is contained in:
Dan Abramov 2017-06-01 12:54:47 -07:00 committed by Facebook Github Bot
parent 84f68804ac
commit 86fad4b2f3
1 changed files with 3 additions and 2 deletions

View File

@ -169,14 +169,15 @@ class Inspector extends React.Component {
// instance that contains it (like View)
const {
hierarchy,
instance,
props,
selection,
source,
} = renderer.getInspectorDataForViewTag(touchedViewTag);
if (this.state.devtoolsAgent) {
this.state.devtoolsAgent.selectFromReactInstance(instance, true);
// Skip host leafs
const offsetFromLeaf = hierarchy.length - 1 - selection;
this.state.devtoolsAgent.selectFromDOMNode(touchedViewTag, true, offsetFromLeaf);
}
this.setState({