diff --git a/src/browser/ui/ReactMount.js b/src/browser/ui/ReactMount.js index c4fe6280fe..78457fcb52 100644 --- a/src/browser/ui/ReactMount.js +++ b/src/browser/ui/ReactMount.js @@ -27,7 +27,6 @@ var ReactUpdates = require('ReactUpdates'); var emptyObject = require('emptyObject'); var containsNode = require('containsNode'); -var getReactRootElementInContainer = require('getReactRootElementInContainer'); var instantiateReactComponent = require('instantiateReactComponent'); var invariant = require('invariant'); var setInnerHTML = require('setInnerHTML'); @@ -73,6 +72,23 @@ function firstDifferenceIndex(string1, string2) { return string1.length === string2.length ? -1 : minLen; } +/** + * @param {DOMElement|DOMDocument} container DOM element that may contain + * a React component + * @return {?*} DOM element that may have the reactRoot ID, or null. + */ +function getReactRootElementInContainer(container) { + if (!container) { + return null; + } + + if (container.nodeType === DOC_NODE_TYPE) { + return container.documentElement; + } else { + return container.firstChild; + } +} + /** * @param {DOMElement} container DOM element that may contain a React component. * @return {?string} A "reactRoot" ID, if a React component is rendered. diff --git a/src/browser/ui/getReactRootElementInContainer.js b/src/browser/ui/getReactRootElementInContainer.js deleted file mode 100644 index 4b8e7dfb65..0000000000 --- a/src/browser/ui/getReactRootElementInContainer.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule getReactRootElementInContainer - */ - -'use strict'; - -var DOC_NODE_TYPE = 9; - -/** - * @param {DOMElement|DOMDocument} container DOM element that may contain - * a React component - * @return {?*} DOM element that may have the reactRoot ID, or null. - */ -function getReactRootElementInContainer(container) { - if (!container) { - return null; - } - - if (container.nodeType === DOC_NODE_TYPE) { - return container.documentElement; - } else { - return container.firstChild; - } -} - -module.exports = getReactRootElementInContainer;