Fix internal fields access for inspector

Reviewed By: sebmarkbage

Differential Revision: D3325549

fbshipit-source-id: d6cf89f5dbbe9db5bec37632e6976c6e537575fb
This commit is contained in:
Alex Kotliarskyi
2016-05-20 12:13:48 -07:00
committed by Facebook Github Bot 8
parent a5083a3cd5
commit e4753867ea
+3 -3
View File
@@ -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,