(container, forceHydrate)
| 18047 | var warnedAboutHydrateAPI = false; |
| 18048 | |
| 18049 | function legacyCreateRootFromDOMContainer(container, forceHydrate) { |
| 18050 | var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container); |
| 18051 | // First clear any existing content. |
| 18052 | if (!shouldHydrate) { |
| 18053 | var warned = false; |
| 18054 | var rootSibling = void 0; |
| 18055 | while (rootSibling = container.lastChild) { |
| 18056 | { |
| 18057 | if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) { |
| 18058 | warned = true; |
| 18059 | warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.'); |
| 18060 | } |
| 18061 | } |
| 18062 | container.removeChild(rootSibling); |
| 18063 | } |
| 18064 | } |
| 18065 | { |
| 18066 | if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) { |
| 18067 | warnedAboutHydrateAPI = true; |
| 18068 | lowPriorityWarning$1(false, 'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v17. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.'); |
| 18069 | } |
| 18070 | } |
| 18071 | // Legacy roots are not async by default. |
| 18072 | var isAsync = false; |
| 18073 | return new ReactRoot(container, isAsync, shouldHydrate); |
| 18074 | } |
| 18075 | |
| 18076 | function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) { |
| 18077 | // TODO: Ensure all entry points contain this check |
no test coverage detected