From e4753867eaf27724cb6e37c90cdbe169cd8135e7 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Fri, 20 May 2016 12:10:20 -0700 Subject: [PATCH] Fix internal fields access for inspector Reviewed By: sebmarkbage Differential Revision: D3325549 fbshipit-source-id: d6cf89f5dbbe9db5bec37632e6976c6e537575fb --- Libraries/Inspector/Inspector.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/Inspector/Inspector.js b/Libraries/Inspector/Inspector.js index d1ee7c93838..0f8276f5bc2 100644 --- a/Libraries/Inspector/Inspector.js +++ b/Libraries/Inspector/Inspector.js @@ -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,