Don't put IDs in the DOM in createElement mode
Ben Alpert committed
Nov 4, 2015 at 11:38 UTC
c193d1a0c2a8b8e01e992d72b86ab47c7f881cb5
3 files changed
+5
-8
src/renderers/dom/client/ReactMount.js
+5
-6
@@ -175,12 +175,11 @@ function unmountComponentFromNode(instance, container) {
175
* @internal
176
*/
177
function hasNonRootReactChild(container) {
178
- var rootElement = getReactRootElementInContainer(container);
179
- return !!(
180
- rootElement &&
181
- internalGetID(rootElement) &&
182
- !rootElement.hasAttribute(ROOT_ATTR_NAME)
183
- );
178
+ var rootEl = getReactRootElementInContainer(container);
179
+ if (rootEl) {
180
+ var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);
181
+ return !!(inst && inst._nativeParent);
182
+ }
183
}
184
185
function getNativeRootInstanceInContainer(container) {
src/renderers/dom/shared/ReactDOMComponent.js
-1
@@ -665,7 +665,6 @@ ReactDOMComponent.Mixin = {
665
if (!this._nativeParent) {
666
DOMPropertyOperations.setAttributeForRoot(el);
667
}
668
- DOMPropertyOperations.setAttributeForID(el, this._domID);
668
this._updateDOMProperties(null, props, transaction);
669
var lazyTree = DOMLazyTree(el);
670
this._createInitialChildren(transaction, props, context, lazyTree);
src/renderers/dom/shared/ReactDOMTextComponent.js
-1
@@ -97,7 +97,6 @@ assign(ReactDOMTextComponent.prototype, {
97
var ownerDocument = nativeContainerInfo._ownerDocument;
98
var el = ownerDocument.createElement('span');
99
ReactDOMComponentTree.precacheNode(this, el);
100
- DOMPropertyOperations.setAttributeForID(el, domID);
100
var lazyTree = DOMLazyTree(el);
101
DOMLazyTree.queueText(lazyTree, this._stringText);
102
return lazyTree;