Home / Class/ ContextTypeConsumer Class — react Architecture

ContextTypeConsumer Class — react Architecture

Architecture documentation for the ContextTypeConsumer class in ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  c47993a3_ea21_fe87_e5a2_6f4853b1ce4d["ContextTypeConsumer"]
  f86e0bfe_918b_05b9_e878_e3df8ce0d8fa["ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js"]
  c47993a3_ea21_fe87_e5a2_6f4853b1ce4d -->|defined in| f86e0bfe_918b_05b9_e878_e3df8ce0d8fa
  aaccc88c_b604_fc5e_eb1a_5e3626159047["shouldComponentUpdate()"]
  c47993a3_ea21_fe87_e5a2_6f4853b1ce4d -->|method| aaccc88c_b604_fc5e_eb1a_5e3626159047
  49d3ee55_1f69_8a48_f65c_82c25c22828a["UNSAFE_componentWillReceiveProps()"]
  c47993a3_ea21_fe87_e5a2_6f4853b1ce4d -->|method| 49d3ee55_1f69_8a48_f65c_82c25c22828a
  cad18ba2_2054_e37c_a08a_acd0ba85ec87["UNSAFE_componentWillUpdate()"]
  c47993a3_ea21_fe87_e5a2_6f4853b1ce4d -->|method| cad18ba2_2054_e37c_a08a_acd0ba85ec87
  c17ad534_3c7a_376c_a5d9_f983dc97e709["render()"]
  c47993a3_ea21_fe87_e5a2_6f4853b1ce4d -->|method| c17ad534_3c7a_376c_a5d9_f983dc97e709

Relationship Graph

Source Code

packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js lines 133–148

    class ContextTypeConsumer extends React.Component {
      static contextType = Ctx;
      shouldComponentUpdate(nextProps, nextState, nextContext) {
        lifecycleContextLog.push(nextContext);
        return true;
      }
      UNSAFE_componentWillReceiveProps(nextProps, nextContext) {
        lifecycleContextLog.push(nextContext);
      }
      UNSAFE_componentWillUpdate(nextProps, nextState, nextContext) {
        lifecycleContextLog.push(nextContext);
      }
      render() {
        return formatValue(this.context);
      }
    }

Frequently Asked Questions

What is the ContextTypeConsumer class?
ContextTypeConsumer is a class in the react codebase, defined in packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js.
Where is ContextTypeConsumer defined?
ContextTypeConsumer is defined in packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js at line 133.

Analyze Your Own Codebase

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

Try Supermodel Free