Don't set innerHTML if content is empty (#8526)

From D4296244:

> Each [...] had a component with innerHTML = '', causing us to go into HTML parsing code in the browser. Doing this takes 0.03ms per parse call which was 10x slower than skipping it.
This commit is contained in:
Ben Alpert
2016-12-07 17:20:57 -08:00
committed by GitHub
parent 4d71a9c580
commit fccebad780
@@ -787,8 +787,9 @@ ReactDOMComponent.Mixin = {
// Intentional use of != to avoid catching zero/false.
var innerHTML = props.dangerouslySetInnerHTML;
if (innerHTML != null) {
if (innerHTML.__html != null) {
DOMLazyTree.queueHTML(lazyTree, innerHTML.__html);
const innerHTMLContent = innerHTML.__html;
if (innerHTMLContent != null && innerHTMLContent !== '') {
DOMLazyTree.queueHTML(lazyTree, innerHTMLContent);
}
} else {
var contentToUse =