function legacyCreateRootFromDOMContainer(container, initialChildren, parentComponent, callback, isHydrationContainer) {
if (isHydrationContainer) {
console.log('-->1-a:初始化渲染')
if (typeof callback === 'function') {
var originalCallback = callback;
callback = function () {
var instance = getPublicRootInstance(root);
originalCallback.call(instance);
};
}
var root = createHydrationContainer(initialChildren, callback, container, LegacyRoot, null, false, false, '', noopOnRecoverableError);
container._reactRootContainer = root;
markContainerAsRoot(root.current, container);
var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
listenToAllSupportedEvents(rootContainerElement);
flushSync();
return root;
} else {
console.log('-->0-a:初始化渲染')
var rootSibling;
while (rootSibling = container.lastChild) {
container.removeChild(rootSibling);
}
if (typeof callback === 'function') {
var _originalCallback = callback;
callback = function () {
var instance = getPublicRootInstance(_root);
_originalCallback.call(instance);
};
}
var _root = createContainer(container, LegacyRoot, null,
false,
false,
'',
noopOnRecoverableError);
container._reactRootContainer = _root;
markContainerAsRoot(_root.current, container);
var _rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
listenToAllSupportedEvents(_rootContainerElement);
console.log('-->0-a,初始化渲染不执行批量更新',)
flushSync(function () {
updateContainer(initialChildren, _root, parentComponent, callback);
});
return _root;
}
}