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

Function getReactRootElementInContainer

code/composition/public/app.js:17636–17646  ·  view source on GitHub ↗
(container)

Source from the content-addressed store, hash-verified

17634}
17635
17636function getReactRootElementInContainer(container) {
17637 if (!container) {
17638 return null;
17639 }
17640
17641 if (container.nodeType === DOCUMENT_NODE) {
17642 return container.documentElement;
17643 } else {
17644 return container.firstChild;
17645 }
17646}
17647
17648function shouldHydrateDueToLegacyHeuristic(container) {
17649 var rootElement = getReactRootElementInContainer(container);

Callers 2

app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected