From 30e9c40898a5b7b72cffd6dd214b062c323803f1 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Wed, 8 Jun 2016 14:30:48 -0700 Subject: [PATCH] Remove unused rootTag Summary: `rootTag` is a lie, it's passed around but never actually used. IIRC `findInstanceByNativeTag` needed it but seems like not anymore. Reviewed By: spicyj Differential Revision: D3382144 fbshipit-source-id: eb96870a3848333e66bf045e78e95c7763812cc4 --- Libraries/Inspector/Inspector.js | 2 -- Libraries/Inspector/InspectorOverlay.js | 2 +- Libraries/Inspector/InspectorUtils.js | 2 +- Libraries/ReactIOS/AppContainer.js | 1 - Libraries/ReactIOS/renderApplication.ios.js | 2 +- 5 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Libraries/Inspector/Inspector.js b/Libraries/Inspector/Inspector.js index 3726597a9..04acc996c 100644 --- a/Libraries/Inspector/Inspector.js +++ b/Libraries/Inspector/Inspector.js @@ -32,7 +32,6 @@ if (window.__REACT_DEVTOOLS_GLOBAL_HOOK__) { class Inspector extends React.Component { props: { inspectedViewTag: ?number, - rootTag: ?number, onRequestRerenderApp: (callback: (tag: ?number) => void) => void }; @@ -198,7 +197,6 @@ class Inspector extends React.Component { {this.state.inspecting && { - var instance = InspectorUtils.findInstanceByNativeTag(this.props.rootTag, nativeViewTag); + var instance = InspectorUtils.findInstanceByNativeTag(nativeViewTag); if (!instance) { return; } diff --git a/Libraries/Inspector/InspectorUtils.js b/Libraries/Inspector/InspectorUtils.js index 75fb42bf4..b9ce53a3b 100644 --- a/Libraries/Inspector/InspectorUtils.js +++ b/Libraries/Inspector/InspectorUtils.js @@ -19,7 +19,7 @@ function traverseOwnerTreeUp(hierarchy, instance) { } } -function findInstanceByNativeTag(rootTag, nativeTag) { +function findInstanceByNativeTag(nativeTag) { return ReactNativeComponentTree.getInstanceFromNode(nativeTag); } diff --git a/Libraries/ReactIOS/AppContainer.js b/Libraries/ReactIOS/AppContainer.js index 43ecd2ef7..a3f3fbe98 100644 --- a/Libraries/ReactIOS/AppContainer.js +++ b/Libraries/ReactIOS/AppContainer.js @@ -33,7 +33,6 @@ var AppContainer = React.createClass({ var inspector = !__DEV__ || this.state.inspector ? null : { this.setState( diff --git a/Libraries/ReactIOS/renderApplication.ios.js b/Libraries/ReactIOS/renderApplication.ios.js index cc6f7292f..53433d8c2 100644 --- a/Libraries/ReactIOS/renderApplication.ios.js +++ b/Libraries/ReactIOS/renderApplication.ios.js @@ -28,7 +28,7 @@ function renderApplication

( 'Expect to have a valid rootTag, instead got ', rootTag ); ReactNative.render( - +