MCPcopy
hub / github.com/plotly/dash / warnNoop

Function warnNoop

dash/deps/react@16.14.0.js:418–432  ·  view source on GitHub ↗
(publicInstance, callerName)

Source from the content-addressed store, hash-verified

416 var didWarnStateUpdateForUnmountedComponent = {};
417
418 function warnNoop(publicInstance, callerName) {
419 {
420 var _constructor = publicInstance.constructor;
421 var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
422 var warningKey = componentName + "." + callerName;
423
424 if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
425 return;
426 }
427
428 error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
429
430 didWarnStateUpdateForUnmountedComponent[warningKey] = true;
431 }
432 }
433 /**
434 * This is the abstract API for an update queue.
435 */

Callers 1

react@16.14.0.jsFile · 0.70

Calls 1

errorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…