diff --git a/src/renderers/dom/client/ReactDOMComponentTree.js b/src/renderers/dom/client/ReactDOMComponentTree.js index 4d9b8315c853c..8ff3260e8508e 100644 --- a/src/renderers/dom/client/ReactDOMComponentTree.js +++ b/src/renderers/dom/client/ReactDOMComponentTree.js @@ -81,7 +81,7 @@ function precacheChildNodes(inst, node) { } var childInst = children[name]; var childID = getRenderedHostOrTextFromComponent(childInst)._domID; - if (childID == null) { + if (childID === 0) { // We're currently unmounting this child in ReactMultiChild; skip it. continue; } diff --git a/src/renderers/dom/shared/ReactDOMComponent.js b/src/renderers/dom/shared/ReactDOMComponent.js index ec5ee6339b483..84c59061da007 100644 --- a/src/renderers/dom/shared/ReactDOMComponent.js +++ b/src/renderers/dom/shared/ReactDOMComponent.js @@ -483,8 +483,8 @@ function ReactDOMComponent(element) { this._previousStyleCopy = null; this._hostNode = null; this._hostParent = null; - this._rootNodeID = null; - this._domID = null; + this._rootNodeID = 0; + this._domID = 0; this._hostContainerInfo = null; this._wrapperState = null; this._topLevelWrapper = null; @@ -1179,8 +1179,8 @@ ReactDOMComponent.Mixin = { this.unmountChildren(safely); ReactDOMComponentTree.uncacheNode(this); EventPluginHub.deleteAllListeners(this); - this._rootNodeID = null; - this._domID = null; + this._rootNodeID = 0; + this._domID = 0; this._wrapperState = null; if (__DEV__) { diff --git a/src/renderers/dom/shared/ReactDOMEmptyComponent.js b/src/renderers/dom/shared/ReactDOMEmptyComponent.js index d77ea340582bd..0a7b8c6b2f01f 100644 --- a/src/renderers/dom/shared/ReactDOMEmptyComponent.js +++ b/src/renderers/dom/shared/ReactDOMEmptyComponent.js @@ -22,7 +22,7 @@ var ReactDOMEmptyComponent = function(instantiate) { this._hostNode = null; this._hostParent = null; this._hostContainerInfo = null; - this._domID = null; + this._domID = 0; }; Object.assign(ReactDOMEmptyComponent.prototype, { mountComponent: function( diff --git a/src/renderers/dom/shared/ReactDOMTextComponent.js b/src/renderers/dom/shared/ReactDOMTextComponent.js index fa589e7886204..24b0027d2600e 100644 --- a/src/renderers/dom/shared/ReactDOMTextComponent.js +++ b/src/renderers/dom/shared/ReactDOMTextComponent.js @@ -43,7 +43,7 @@ var ReactDOMTextComponent = function(text) { this._hostParent = null; // Properties - this._domID = null; + this._domID = 0; this._mountIndex = 0; this._closingComment = null; this._commentNodes = null; diff --git a/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js b/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js index c2ccb39c2cec4..f87922d9e4f2d 100644 --- a/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js +++ b/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js @@ -675,7 +675,7 @@ describe('ReactDOMComponent', function() { var NodeStub = function(initialProps) { this._currentElement = {props: initialProps}; - this._rootNodeID = 'test'; + this._rootNodeID = 1; }; Object.assign(NodeStub.prototype, ReactDOMComponent.Mixin); @@ -731,7 +731,7 @@ describe('ReactDOMComponent', function() { var NodeStub = function(initialProps) { this._currentElement = {props: initialProps}; - this._rootNodeID = 'test'; + this._rootNodeID = 1; }; Object.assign(NodeStub.prototype, ReactDOMComponent.Mixin); diff --git a/src/renderers/native/ReactNativeBaseComponent.js b/src/renderers/native/ReactNativeBaseComponent.js index 0a0c8435b799d..5d131739fc986 100644 --- a/src/renderers/native/ReactNativeBaseComponent.js +++ b/src/renderers/native/ReactNativeBaseComponent.js @@ -59,7 +59,7 @@ ReactNativeBaseComponent.Mixin = { ReactNativeComponentTree.uncacheNode(this); deleteAllListeners(this); this.unmountChildren(); - this._rootNodeID = null; + this._rootNodeID = 0; }, /** diff --git a/src/renderers/native/ReactNativeTextComponent.js b/src/renderers/native/ReactNativeTextComponent.js index 67a9b865fa421..8e815f9efb20a 100644 --- a/src/renderers/native/ReactNativeTextComponent.js +++ b/src/renderers/native/ReactNativeTextComponent.js @@ -22,7 +22,7 @@ var ReactNativeTextComponent = function(text) { this._currentElement = text; this._stringText = '' + text; this._hostParent = null; - this._rootNodeID = null; + this._rootNodeID = 0; }; Object.assign(ReactNativeTextComponent.prototype, { @@ -73,7 +73,7 @@ Object.assign(ReactNativeTextComponent.prototype, { ReactNativeComponentTree.uncacheNode(this); this._currentElement = null; this._stringText = null; - this._rootNodeID = null; + this._rootNodeID = 0; }, }); diff --git a/src/renderers/native/createReactNativeComponentClass.js b/src/renderers/native/createReactNativeComponentClass.js index adb0740bcf88e..351a2b5797858 100644 --- a/src/renderers/native/createReactNativeComponentClass.js +++ b/src/renderers/native/createReactNativeComponentClass.js @@ -33,7 +33,7 @@ var createReactNativeComponentClass = function( this._topLevelWrapper = null; this._hostParent = null; this._hostContainerInfo = null; - this._rootNodeID = null; + this._rootNodeID = 0; this._renderedChildren = null; }; Constructor.displayName = viewConfig.uiViewClassName; diff --git a/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js b/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js index 9b878829aaa66..bce59875a2e08 100644 --- a/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js +++ b/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js @@ -150,7 +150,7 @@ var ReactCompositeComponentMixin = { */ construct: function(element) { this._currentElement = element; - this._rootNodeID = null; + this._rootNodeID = 0; this._compositeType = null; this._instance = null; this._hostParent = null; @@ -609,7 +609,7 @@ var ReactCompositeComponentMixin = { // These fields do not really need to be reset since this object is no // longer accessible. this._context = null; - this._rootNodeID = null; + this._rootNodeID = 0; this._topLevelWrapper = null; // Delete the reference from the instance to this internal representation