Home / Class/ MyComponent Class — react Architecture

MyComponent Class — react Architecture

Architecture documentation for the MyComponent class in ReactIncremental-test.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  6fcc0a96_801c_c0c5_b28f_cbf700fb9a63["MyComponent"]
  e830a60d_4147_3606_7890_6db744e9073f["ReactIncremental-test.js"]
  6fcc0a96_801c_c0c5_b28f_cbf700fb9a63 -->|defined in| e830a60d_4147_3606_7890_6db744e9073f
  3bf2b862_3531_38f5_e176_cc4b9c1f45e6["componentDidMount()"]
  6fcc0a96_801c_c0c5_b28f_cbf700fb9a63 -->|method| 3bf2b862_3531_38f5_e176_cc4b9c1f45e6
  74fe7dd9_18cb_5200_573e_a8d6fa582774["componentDidUpdate()"]
  6fcc0a96_801c_c0c5_b28f_cbf700fb9a63 -->|method| 74fe7dd9_18cb_5200_573e_a8d6fa582774
  276cba93_6dec_09a6_5bdb_65a47b18030a["UNSAFE_componentWillReceiveProps()"]
  6fcc0a96_801c_c0c5_b28f_cbf700fb9a63 -->|method| 276cba93_6dec_09a6_5bdb_65a47b18030a
  8dfe5da8_619c_951d_fc89_f0c02f1c5f02["render()"]
  6fcc0a96_801c_c0c5_b28f_cbf700fb9a63 -->|method| 8dfe5da8_619c_951d_fc89_f0c02f1c5f02
  1cf215c9_1b8c_e13e_2e42_44738901e70a["shouldComponentUpdate()"]
  6fcc0a96_801c_c0c5_b28f_cbf700fb9a63 -->|method| 1cf215c9_1b8c_e13e_2e42_44738901e70a

Relationship Graph

Source Code

packages/react-reconciler/src/__tests__/ReactIncremental-test.js lines 2296–2320

    class MyComponent extends React.Component {
      static contextTypes = {};
      componentDidMount(prevProps, prevState) {
        Scheduler.log('componentDidMount');
        this.setState({setStateInCDU: true});
      }
      componentDidUpdate(prevProps, prevState) {
        Scheduler.log('componentDidUpdate');
        if (this.state.setStateInCDU) {
          this.setState({setStateInCDU: false});
        }
      }
      UNSAFE_componentWillReceiveProps(nextProps) {
        Scheduler.log('componentWillReceiveProps');
        this.setState({setStateInCDU: true});
      }
      render() {
        Scheduler.log('render');
        return null;
      }
      shouldComponentUpdate(nextProps, nextState) {
        Scheduler.log('shouldComponentUpdate');
        return scuCounter++ < 5; // Don't let test hang
      }
    }

Frequently Asked Questions

What is the MyComponent class?
MyComponent is a class in the react codebase, defined in packages/react-reconciler/src/__tests__/ReactIncremental-test.js.
Where is MyComponent defined?
MyComponent is defined in packages/react-reconciler/src/__tests__/ReactIncremental-test.js at line 2296.

Analyze Your Own Codebase

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

Try Supermodel Free