MCPcopy Index your code
hub / github.com/plotly/dash / warnIfReactDOMContainerInDEV

Function warnIfReactDOMContainerInDEV

dash/deps/react-dom@18.2.0.js:29471–29485  ·  view source on GitHub ↗
(container)

Source from the content-addressed store, hash-verified

29469 }
29470
29471 function warnIfReactDOMContainerInDEV(container) {
29472 {
29473 if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') {
29474 error('createRoot(): Creating roots directly with document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try using a container element created ' + 'for your app.');
29475 }
29476
29477 if (isContainerMarkedAsRoot(container)) {
29478 if (container._reactRootContainer) {
29479 error('You are calling ReactDOMClient.createRoot() on a container that was previously ' + 'passed to ReactDOM.render(). This is not supported.');
29480 } else {
29481 error('You are calling ReactDOMClient.createRoot() on a container that ' + 'has already been passed to createRoot() before. Instead, call ' + 'root.render() on the existing root instead if you want to update it.');
29482 }
29483 }
29484 }
29485 }
29486
29487 var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
29488 var topLevelUpdateWarnings;

Callers 2

createRootFunction · 0.70
hydrateRootFunction · 0.70

Calls 2

errorFunction · 0.70
isContainerMarkedAsRootFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…