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
This commit is contained in:
parent
f26c908638
commit
30e9c40898
|
@ -32,7 +32,6 @@ if (window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||||
class Inspector extends React.Component {
|
class Inspector extends React.Component {
|
||||||
props: {
|
props: {
|
||||||
inspectedViewTag: ?number,
|
inspectedViewTag: ?number,
|
||||||
rootTag: ?number,
|
|
||||||
onRequestRerenderApp: (callback: (tag: ?number) => void) => void
|
onRequestRerenderApp: (callback: (tag: ?number) => void) => void
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -198,7 +197,6 @@ class Inspector extends React.Component {
|
||||||
<View style={styles.container} pointerEvents="box-none">
|
<View style={styles.container} pointerEvents="box-none">
|
||||||
{this.state.inspecting &&
|
{this.state.inspecting &&
|
||||||
<InspectorOverlay
|
<InspectorOverlay
|
||||||
rootTag={this.props.rootTag}
|
|
||||||
inspected={this.state.inspected}
|
inspected={this.state.inspected}
|
||||||
inspectedViewTag={this.state.inspectedViewTag}
|
inspectedViewTag={this.state.inspectedViewTag}
|
||||||
onTouchInstance={this.onTouchInstance.bind(this)}
|
onTouchInstance={this.onTouchInstance.bind(this)}
|
||||||
|
|
|
@ -41,7 +41,7 @@ var InspectorOverlay = React.createClass({
|
||||||
this.props.inspectedViewTag,
|
this.props.inspectedViewTag,
|
||||||
[locationX, locationY],
|
[locationX, locationY],
|
||||||
(nativeViewTag, left, top, width, height) => {
|
(nativeViewTag, left, top, width, height) => {
|
||||||
var instance = InspectorUtils.findInstanceByNativeTag(this.props.rootTag, nativeViewTag);
|
var instance = InspectorUtils.findInstanceByNativeTag(nativeViewTag);
|
||||||
if (!instance) {
|
if (!instance) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ function traverseOwnerTreeUp(hierarchy, instance) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function findInstanceByNativeTag(rootTag, nativeTag) {
|
function findInstanceByNativeTag(nativeTag) {
|
||||||
return ReactNativeComponentTree.getInstanceFromNode(nativeTag);
|
return ReactNativeComponentTree.getInstanceFromNode(nativeTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,6 @@ var AppContainer = React.createClass({
|
||||||
var inspector = !__DEV__ || this.state.inspector
|
var inspector = !__DEV__ || this.state.inspector
|
||||||
? null
|
? null
|
||||||
: <Inspector
|
: <Inspector
|
||||||
rootTag={this.props.rootTag}
|
|
||||||
inspectedViewTag={ReactNative.findNodeHandle(this.refs.main)}
|
inspectedViewTag={ReactNative.findNodeHandle(this.refs.main)}
|
||||||
onRequestRerenderApp={(updateInspectedViewTag) => {
|
onRequestRerenderApp={(updateInspectedViewTag) => {
|
||||||
this.setState(
|
this.setState(
|
||||||
|
|
|
@ -28,7 +28,7 @@ function renderApplication<P>(
|
||||||
'Expect to have a valid rootTag, instead got ', rootTag
|
'Expect to have a valid rootTag, instead got ', rootTag
|
||||||
);
|
);
|
||||||
ReactNative.render(
|
ReactNative.render(
|
||||||
<AppContainer rootTag={rootTag}>
|
<AppContainer>
|
||||||
<RootComponent
|
<RootComponent
|
||||||
{...initialProps}
|
{...initialProps}
|
||||||
rootTag={rootTag}
|
rootTag={rootTag}
|
||||||
|
|
Loading…
Reference in New Issue