Home / Function/ updateContextProvider() — react Function Reference

updateContextProvider() — react Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberBeginWork.js lines 3655–3673

function updateContextProvider(
  current: Fiber | null,
  workInProgress: Fiber,
  renderLanes: Lanes,
) {
  const context: ReactContext<any> = workInProgress.type;
  const newProps = workInProgress.pendingProps;
  const newValue = newProps.value;

  if (__DEV__) {
    if (!('value' in newProps)) {
      if (!hasWarnedAboutUsingNoValuePropOnContextProvider) {
        hasWarnedAboutUsingNoValuePropOnContextProvider = true;
        console.error(
          'The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?',
        );
      }
    }
  }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free