mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix internal fields access for inspector
Reviewed By: sebmarkbage Differential Revision: D3325549 fbshipit-source-id: d6cf89f5dbbe9db5bec37632e6976c6e537575fb
This commit is contained in:
committed by
Facebook Github Bot 8
parent
a5083a3cd5
commit
e4753867ea
@@ -129,7 +129,7 @@ class Inspector extends React.Component {
|
||||
// if we inspect a stateless component we can't use the getPublicInstance method
|
||||
// therefore we use the internal _instance property directly.
|
||||
var publicInstance = instance['_instance'] || {};
|
||||
var source = instance._currentElement && instance._currentElement._source;
|
||||
var source = instance['_currentElement'] && instance['_currentElement']['_source'];
|
||||
UIManager.measure(instance.getNativeNode(), (x, y, width, height, left, top) => {
|
||||
this.setState({
|
||||
inspected: {
|
||||
@@ -149,9 +149,9 @@ class Inspector extends React.Component {
|
||||
var hierarchy = InspectorUtils.getOwnerHierarchy(instance);
|
||||
// if we inspect a stateless component we can't use the getPublicInstance method
|
||||
// therefore we use the internal _instance property directly.
|
||||
var publicInstance = instance._instance || {};
|
||||
var publicInstance = instance['_instance'] || {};
|
||||
var props = publicInstance.props || {};
|
||||
var source = instance._currentElement && instance._currentElement._source;
|
||||
var source = instance['_currentElement'] && instance['_currentElement']['_source'];
|
||||
this.setState({
|
||||
panelPos: pointerY > Dimensions.get('window').height / 2 ? 'top' : 'bottom',
|
||||
selection: hierarchy.length - 1,
|
||||
|
||||
Reference in New Issue
Block a user