MCPcopy Create free account
hub / github.com/Lobos/react-ui / getReactRootElementInContainer

Function getReactRootElementInContainer

docs/lib/react.js:11166–11176  ·  view source on GitHub ↗

* @param {DOMElement|DOMDocument} container DOM element that may contain * a React component * @return {?*} DOM element that may have the reactRoot ID, or null.

(container)

Source from the content-addressed store, hash-verified

11164 * @return {?*} DOM element that may have the reactRoot ID, or null.
11165 */
11166function getReactRootElementInContainer(container) {
11167 if (!container) {
11168 return null;
11169 }
11170
11171 if (container.nodeType === DOC_NODE_TYPE) {
11172 return container.documentElement;
11173 } else {
11174 return container.firstChild;
11175 }
11176}
11177
11178function internalGetID(node) {
11179 // If node is something like a window, document, or text node, none of

Callers 3

hasNonRootReactChildFunction · 0.85
react.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…