simplify mountImageIntoNode's way of putting markup in innerHTML

Instead of removing the node from the document before changing its innerHTML, just do it directly.
The comment seems to be outdated for years. http://jsperf.com/detach-while-setting-innerhtml
This commit is contained in:
Cheng Lou
2014-02-20 15:59:05 -08:00
committed by Paul O’Shannessy
parent 5545887a48
commit 7eb33ef176
@@ -133,21 +133,7 @@ var ReactComponentBrowserEnvironment = {
'See renderComponentToString() for server rendering.'
);
// Asynchronously inject markup by ensuring that the container is not in
// the document when settings its `innerHTML`.
var parent = container.parentNode;
if (parent) {
var next = container.nextSibling;
parent.removeChild(container);
container.innerHTML = markup;
if (next) {
parent.insertBefore(container, next);
} else {
parent.appendChild(container);
}
} else {
container.innerHTML = markup;
}
container.innerHTML = markup;
}
)
};