MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / warnNoop

Function warnNoop

code/composition/public/app.js:18579–18590  ·  view source on GitHub ↗
(publicInstance, callerName)

Source from the content-addressed store, hash-verified

18577var didWarnStateUpdateForUnmountedComponent = {};
18578
18579function warnNoop(publicInstance, callerName) {
18580 {
18581 var _constructor = publicInstance.constructor;
18582 var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
18583 var warningKey = componentName + '.' + callerName;
18584 if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
18585 return;
18586 }
18587 warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, componentName);
18588 didWarnStateUpdateForUnmountedComponent[warningKey] = true;
18589 }
18590}
18591
18592/**
18593 * This is the abstract API for an update queue.

Callers 1

app.jsFile · 0.70

Calls 1

warningFunction · 0.85

Tested by

no test coverage detected