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 authored and Paul O’Shannessy committed 2014-02-20 16:54:43 -08:00
1 parent 5545887a48
commit 7eb33ef176
1 file changed
+1 -15
@@ -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;
}
)
};