MCPcopy Index your code
hub / github.com/react/react / warnIfReactDOMContainerInDEV

Function warnIfReactDOMContainerInDEV

packages/react-dom/src/client/ReactDOMRoot.js:360–377  ·  view source on GitHub ↗
(container: any)

Source from the content-addressed store, hash-verified

358}
359
360function warnIfReactDOMContainerInDEV(container: any) {
361 if (__DEV__) {
362 if (isContainerMarkedAsRoot(container)) {
363 if (container._reactRootContainer) {
364 console.error(
365 'You are calling ReactDOMClient.createRoot() on a container that was previously ' +
366 'passed to ReactDOM.render(). This is not supported.',
367 );
368 } else {
369 console.error(
370 'You are calling ReactDOMClient.createRoot() on a container that ' +
371 'has already been passed to createRoot() before. Instead, call ' +
372 'root.render() on the existing root instead if you want to update it.',
373 );
374 }
375 }
376 }
377}

Callers 2

createRootFunction · 0.85
hydrateRootFunction · 0.85

Calls 2

isContainerMarkedAsRootFunction · 0.90
errorMethod · 0.65

Tested by

no test coverage detected