diff --git a/src/renderers/dom/fiber/ReactDOMFiber.js b/src/renderers/dom/fiber/ReactDOMFiber.js index 65b547fb5a..5718e45c18 100644 --- a/src/renderers/dom/fiber/ReactDOMFiber.js +++ b/src/renderers/dom/fiber/ReactDOMFiber.js @@ -399,10 +399,11 @@ var ReactDOM = { if (__DEV__) { const isRootRenderedBySomeReact = Boolean(container._reactRootContainer); - const isInTreeRenderedByThisReact = ReactDOMComponentTree.getInstanceFromNode(container); + const rootEl = getReactRootElementInContainer(container); + const hasNonRootReactChild = Boolean(rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl)); warning( - !isInTreeRenderedByThisReact || + !hasNonRootReactChild || isRootRenderedBySomeReact, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' +