MCPcopy Index your code
hub / github.com/caseywebdev/react-list / warnAboutUpdateOnNotYetMountedFiberInDEV

Function warnAboutUpdateOnNotYetMountedFiberInDEV

docs/index.js:34404–34427  ·  view source on GitHub ↗
(fiber)

Source from the content-addressed store, hash-verified

34402 );
34403 }
34404 function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {
34405 if ((executionContext & RenderContext) === NoContext) {
34406 var tag = fiber.tag;
34407 if (
34408 3 === tag ||
34409 1 === tag ||
34410 0 === tag ||
34411 11 === tag ||
34412 14 === tag ||
34413 15 === tag
34414 ) {
34415 tag = getComponentNameFromFiber(fiber) || "ReactComponent";
34416 if (null !== didWarnStateUpdateForNotYetMountedComponent) {
34417 if (didWarnStateUpdateForNotYetMountedComponent.has(tag)) return;
34418 didWarnStateUpdateForNotYetMountedComponent.add(tag);
34419 } else didWarnStateUpdateForNotYetMountedComponent = new Set([tag]);
34420 runWithFiberInDEV(fiber, function () {
34421 console.error(
34422 "Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead."
34423 );
34424 });
34425 }
34426 }
34427 }
34428 function restorePendingUpdaters(root, lanes) {
34429 isDevToolsPresent &&
34430 root.memoizedUpdaters.forEach(function (schedulingFiber) {

Callers 1

getRootForUpdatedFiberFunction · 0.85

Calls 2

runWithFiberInDEVFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…