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

Function hydrate

docs/external/js/react-dom.development.js:24942–24959  ·  view source on GitHub ↗
(element, container, callback)

Source from the content-addressed store, hash-verified

24940 }
24941 }
24942 function hydrate(element, container, callback) {
24943 if (!isValidContainer(container)) {
24944 {
24945 throw Error( "Target container is not a DOM element." );
24946 }
24947 }
24948
24949 {
24950 var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;
24951
24952 if (isModernRoot) {
24953 error('You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?');
24954 }
24955 } // TODO: throw or warn if we couldn't hydrate?
24956
24957
24958 return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
24959 }
24960 function render(element, container, callback) {
24961 if (!isValidContainer(container)) {
24962 {

Callers

nothing calls this directly

Calls 4

isValidContainerFunction · 0.85
isContainerMarkedAsRootFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected