Home / Class/ ContextTypeConsumer Class — react Architecture

ContextTypeConsumer Class — react Architecture

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

Entity Profile

Dependency Diagram

graph TD
  7dd696fa_a387_7caf_0ff6_372d0f689695["ContextTypeConsumer"]
  e1a64d52_93c7_f41d_b725_ab5b65a89f2d["ReactLegacyContextDisabled-test.internal.js"]
  7dd696fa_a387_7caf_0ff6_372d0f689695 -->|defined in| e1a64d52_93c7_f41d_b725_ab5b65a89f2d
  dbc0a409_1337_b1d8_81e5_7815b46e67da["shouldComponentUpdate()"]
  7dd696fa_a387_7caf_0ff6_372d0f689695 -->|method| dbc0a409_1337_b1d8_81e5_7815b46e67da
  0519579b_d967_bfb5_4438_ea53045165e4["UNSAFE_componentWillReceiveProps()"]
  7dd696fa_a387_7caf_0ff6_372d0f689695 -->|method| 0519579b_d967_bfb5_4438_ea53045165e4
  8c042249_6b36_475b_84f6_7fb8a695ed31["UNSAFE_componentWillUpdate()"]
  7dd696fa_a387_7caf_0ff6_372d0f689695 -->|method| 8c042249_6b36_475b_84f6_7fb8a695ed31
  4a8b9a01_b908_0936_3977_0c762c951a5b["render()"]
  7dd696fa_a387_7caf_0ff6_372d0f689695 -->|method| 4a8b9a01_b908_0936_3977_0c762c951a5b

Relationship Graph

Source Code

packages/react-dom/src/__tests__/ReactLegacyContextDisabled-test.internal.js lines 177–192

    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__/ReactLegacyContextDisabled-test.internal.js.
Where is ContextTypeConsumer defined?
ContextTypeConsumer is defined in packages/react-dom/src/__tests__/ReactLegacyContextDisabled-test.internal.js at line 177.

Analyze Your Own Codebase

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

Try Supermodel Free