From 1a4aaeaec19746442d12ce00981099e15b8dafc3 Mon Sep 17 00:00:00 2001 From: Yoni Shalom Date: Wed, 10 Sep 2014 09:32:56 +0300 Subject: [PATCH] when looking for a react root element the function would look at the 'container.firstChild' attribute, which is a convenience for childNodes[0]. this might be non-html nodes (#text for example), causing hierarchies containing spaces between the container and child (react root element) to fail locating the react root elem. modified to '.firstElementChild', which is a similar convenience for children[0] --- src/browser/ui/getReactRootElementInContainer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/ui/getReactRootElementInContainer.js b/src/browser/ui/getReactRootElementInContainer.js index 3ecf18194dc..896cee25a54 100644 --- a/src/browser/ui/getReactRootElementInContainer.js +++ b/src/browser/ui/getReactRootElementInContainer.js @@ -33,7 +33,7 @@ function getReactRootElementInContainer(container) { if (container.nodeType === DOC_NODE_TYPE) { return container.documentElement; } else { - return container.firstChild; + return container.firstElementChild; } }