MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / getReactRootElementInContainer

Function getReactRootElementInContainer

code/styling/public/app.js:17498–17508  ·  view source on GitHub ↗
(container)

Source from the content-addressed store, hash-verified

17496}
17497
17498function getReactRootElementInContainer(container) {
17499 if (!container) {
17500 return null;
17501 }
17502
17503 if (container.nodeType === DOCUMENT_NODE) {
17504 return container.documentElement;
17505 } else {
17506 return container.firstChild;
17507 }
17508}
17509
17510function shouldHydrateDueToLegacyHeuristic(container) {
17511 var rootElement = getReactRootElementInContainer(container);

Callers 2

app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected