MCPcopy Create free account
hub / github.com/microsoft/SandDance / createRootImpl

Function createRootImpl

docs/external/js/react-dom.development.js:24757–24770  ·  view source on GitHub ↗
(container, tag, options)

Source from the content-addressed store, hash-verified

24755 };
24756
24757 function createRootImpl(container, tag, options) {
24758 // Tag is either LegacyRoot or Concurrent Root
24759 var hydrate = options != null && options.hydrate === true;
24760 var hydrationCallbacks = options != null && options.hydrationOptions || null;
24761 var root = createContainer(container, tag, hydrate);
24762 markContainerAsRoot(root.current, container);
24763
24764 if (hydrate && tag !== LegacyRoot) {
24765 var doc = container.nodeType === DOCUMENT_NODE ? container : container.ownerDocument;
24766 eagerlyTrapReplayableEvents(container, doc);
24767 }
24768
24769 return root;
24770 }
24771 function createLegacyRoot(container, options) {
24772 return new ReactDOMBlockingRoot(container, LegacyRoot, options);
24773 }

Callers 2

ReactDOMRootFunction · 0.85
ReactDOMBlockingRootFunction · 0.85

Calls 3

createContainerFunction · 0.85
markContainerAsRootFunction · 0.85

Tested by

no test coverage detected