Skip to content

Commit

Permalink
Don't put IDs in the DOM in createElement mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiebits committed Nov 4, 2015
1 parent b80f676 commit c193d1a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
11 changes: 5 additions & 6 deletions src/renderers/dom/client/ReactMount.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,11 @@ function unmountComponentFromNode(instance, container) {
* @internal
*/
function hasNonRootReactChild(container) {
var rootElement = getReactRootElementInContainer(container);
return !!(
rootElement &&
internalGetID(rootElement) &&
!rootElement.hasAttribute(ROOT_ATTR_NAME)
);
var rootEl = getReactRootElementInContainer(container);
if (rootEl) {
var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);
return !!(inst && inst._nativeParent);
}
}

function getNativeRootInstanceInContainer(container) {
Expand Down
1 change: 0 additions & 1 deletion src/renderers/dom/shared/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,6 @@ ReactDOMComponent.Mixin = {
if (!this._nativeParent) {
DOMPropertyOperations.setAttributeForRoot(el);
}
DOMPropertyOperations.setAttributeForID(el, this._domID);
this._updateDOMProperties(null, props, transaction);
var lazyTree = DOMLazyTree(el);
this._createInitialChildren(transaction, props, context, lazyTree);
Expand Down
1 change: 0 additions & 1 deletion src/renderers/dom/shared/ReactDOMTextComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ assign(ReactDOMTextComponent.prototype, {
var ownerDocument = nativeContainerInfo._ownerDocument;
var el = ownerDocument.createElement('span');
ReactDOMComponentTree.precacheNode(this, el);
DOMPropertyOperations.setAttributeForID(el, domID);
var lazyTree = DOMLazyTree(el);
DOMLazyTree.queueText(lazyTree, this._stringText);
return lazyTree;
Expand Down

0 comments on commit c193d1a

Please sign in to comment.