Home / Function/ updateContextConsumer() — react Function Reference

updateContextConsumer() — react Function Reference

Architecture documentation for the updateContextConsumer() function in ReactFiberBeginWork.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  ad7ec4b9_29ea_1566_63f1_565eeb8f47d5["updateContextConsumer()"]
  0be70812_cc0c_b210_f84f_8e61dd5f831c["ReactFiberBeginWork.js"]
  ad7ec4b9_29ea_1566_63f1_565eeb8f47d5 -->|defined in| 0be70812_cc0c_b210_f84f_8e61dd5f831c
  235e1db1_02a4_912f_7d82_ea6636c850c0["beginWork()"]
  235e1db1_02a4_912f_7d82_ea6636c850c0 -->|calls| ad7ec4b9_29ea_1566_63f1_565eeb8f47d5
  style ad7ec4b9_29ea_1566_63f1_565eeb8f47d5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberBeginWork.js lines 3682–3701

function updateContextConsumer(
  current: Fiber | null,
  workInProgress: Fiber,
  renderLanes: Lanes,
) {
  const consumerType: ReactConsumerType<any> = workInProgress.type;
  const context: ReactContext<any> = consumerType._context;
  const newProps = workInProgress.pendingProps;
  const render = newProps.children;

  if (__DEV__) {
    if (typeof render !== 'function') {
      console.error(
        'A context consumer was rendered with multiple children, or a child ' +
          "that isn't a function. A context consumer expects a single child " +
          'that is a function. If you did pass a function, make sure there ' +
          'is no trailing or leading whitespace around it.',
      );
    }
  }

Domain

Subdomains

Called By

Frequently Asked Questions

What does updateContextConsumer() do?
updateContextConsumer() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberBeginWork.js.
Where is updateContextConsumer() defined?
updateContextConsumer() is defined in packages/react-reconciler/src/ReactFiberBeginWork.js at line 3682.
What calls updateContextConsumer()?
updateContextConsumer() is called by 1 function(s): beginWork.

Analyze Your Own Codebase

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

Try Supermodel Free