Home / Function/ warnOnInvalidCallback() — react Function Reference

warnOnInvalidCallback() — react Function Reference

Architecture documentation for the warnOnInvalidCallback() function in ReactFiberClassComponent.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  bcb479c4_0d2d_6b5c_21b4_a83ba99d5412["warnOnInvalidCallback()"]
  3805476a_1924_0e35_fff7_6afad197a523["ReactFiberClassComponent.js"]
  bcb479c4_0d2d_6b5c_21b4_a83ba99d5412 -->|defined in| 3805476a_1924_0e35_fff7_6afad197a523
  fab0e08a_05bb_b313_9232_4883323d5316["classComponentUpdater.payload()"]
  fab0e08a_05bb_b313_9232_4883323d5316 -->|calls| bcb479c4_0d2d_6b5c_21b4_a83ba99d5412
  style bcb479c4_0d2d_6b5c_21b4_a83ba99d5412 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberClassComponent.js lines 95–111

function warnOnInvalidCallback(callback: mixed) {
  if (__DEV__) {
    if (callback === null || typeof callback === 'function') {
      return;
    }
    // eslint-disable-next-line react-internal/safe-string-coercion
    const key = String(callback);
    if (!didWarnOnInvalidCallback.has(key)) {
      didWarnOnInvalidCallback.add(key);
      console.error(
        'Expected the last optional `callback` argument to be a ' +
          'function. Instead received: %s.',
        callback,
      );
    }
  }
}

Domain

Subdomains

Frequently Asked Questions

What does warnOnInvalidCallback() do?
warnOnInvalidCallback() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberClassComponent.js.
Where is warnOnInvalidCallback() defined?
warnOnInvalidCallback() is defined in packages/react-reconciler/src/ReactFiberClassComponent.js at line 95.
What calls warnOnInvalidCallback()?
warnOnInvalidCallback() is called by 1 function(s): classComponentUpdater.payload.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free