Home / Class/ LegacyClsConsumer Class — react Architecture

LegacyClsConsumer Class — react Architecture

Architecture documentation for the LegacyClsConsumer class in ReactLegacyContextDisabled-test.internal.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  68dddfce_67d8_81e9_b17e_d9465261dc00["LegacyClsConsumer"]
  e1a64d52_93c7_f41d_b725_ab5b65a89f2d["ReactLegacyContextDisabled-test.internal.js"]
  68dddfce_67d8_81e9_b17e_d9465261dc00 -->|defined in| e1a64d52_93c7_f41d_b725_ab5b65a89f2d
  e1ff34b6_3e58_eeaf_ffd6_28c8dd79e18c["shouldComponentUpdate()"]
  68dddfce_67d8_81e9_b17e_d9465261dc00 -->|method| e1ff34b6_3e58_eeaf_ffd6_28c8dd79e18c
  193abab1_9320_eebc_e586_129a736b2ee7["UNSAFE_componentWillReceiveProps()"]
  68dddfce_67d8_81e9_b17e_d9465261dc00 -->|method| 193abab1_9320_eebc_e586_129a736b2ee7
  4dd8528a_176d_35fd_4258_3dc57cabdaf7["UNSAFE_componentWillUpdate()"]
  68dddfce_67d8_81e9_b17e_d9465261dc00 -->|method| 4dd8528a_176d_35fd_4258_3dc57cabdaf7
  067feb5d_fda3_7d9f_971c_4444c133259e["render()"]
  68dddfce_67d8_81e9_b17e_d9465261dc00 -->|method| 067feb5d_fda3_7d9f_971c_4444c133259e

Relationship Graph

Source Code

packages/react-dom/src/__tests__/ReactLegacyContextDisabled-test.internal.js lines 60–77

    class LegacyClsConsumer extends React.Component {
      static contextTypes = {
        foo() {},
      };
      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 LegacyClsConsumer class?
LegacyClsConsumer is a class in the react codebase, defined in packages/react-dom/src/__tests__/ReactLegacyContextDisabled-test.internal.js.
Where is LegacyClsConsumer defined?
LegacyClsConsumer is defined in packages/react-dom/src/__tests__/ReactLegacyContextDisabled-test.internal.js at line 60.

Analyze Your Own Codebase

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

Try Supermodel Free