Home / Class/ Component Class — react Architecture

Component Class — react Architecture

Architecture documentation for the Component class in ReactClassComponentPropResolution-test.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  90d20c1f_4159_3f9d_ae02_974da4dd1207["Component"]
  304f15d3_d06c_4613_01fe_34a9ee751e40["ReactClassComponentPropResolution-test.js"]
  90d20c1f_4159_3f9d_ae02_974da4dd1207 -->|defined in| 304f15d3_d06c_4613_01fe_34a9ee751e40
  0eefb8c0_5c64_c976_1884_93c4052e910d["constructor()"]
  90d20c1f_4159_3f9d_ae02_974da4dd1207 -->|method| 0eefb8c0_5c64_c976_1884_93c4052e910d
  14a19131_9420_8680_5743_c1dbc3df93a8["shouldComponentUpdate()"]
  90d20c1f_4159_3f9d_ae02_974da4dd1207 -->|method| 14a19131_9420_8680_5743_c1dbc3df93a8
  69a59e7c_d0de_1ae0_ba87_fd89f4f2af35["componentDidUpdate()"]
  90d20c1f_4159_3f9d_ae02_974da4dd1207 -->|method| 69a59e7c_d0de_1ae0_ba87_fd89f4f2af35
  8ebbdf47_22f9_f61f_2c3e_c793c14c4e67["componentDidMount()"]
  90d20c1f_4159_3f9d_ae02_974da4dd1207 -->|method| 8ebbdf47_22f9_f61f_2c3e_c793c14c4e67
  f00de0be_570c_33bc_9012_f63aec13a2ae["UNSAFE_componentWillMount()"]
  90d20c1f_4159_3f9d_ae02_974da4dd1207 -->|method| f00de0be_570c_33bc_9012_f63aec13a2ae
  53528e26_2e68_ce05_2cfa_5f636d3ba997["UNSAFE_componentWillReceiveProps()"]
  90d20c1f_4159_3f9d_ae02_974da4dd1207 -->|method| 53528e26_2e68_ce05_2cfa_5f636d3ba997
  f0460df3_ac54_7607_6aef_e36c38a53460["UNSAFE_componentWillUpdate()"]
  90d20c1f_4159_3f9d_ae02_974da4dd1207 -->|method| f0460df3_ac54_7607_6aef_e36c38a53460
  e5ff66fe_0ae8_edae_176c_43ecbfd79e09["componentWillUnmount()"]
  90d20c1f_4159_3f9d_ae02_974da4dd1207 -->|method| e5ff66fe_0ae8_edae_176c_43ecbfd79e09
  c7f6295d_e82c_fc68_e021_8bc316d05775["render()"]
  90d20c1f_4159_3f9d_ae02_974da4dd1207 -->|method| c7f6295d_e82c_fc68_e021_8bc316d05775

Relationship Graph

Source Code

packages/react-reconciler/src/__tests__/ReactClassComponentPropResolution-test.js lines 41–91

    class Component extends React.Component {
      constructor(props) {
        super(props);
        Scheduler.log('constructor: ' + getPropKeys(props));
      }
      shouldComponentUpdate(props) {
        Scheduler.log(
          'shouldComponentUpdate (prev props): ' + getPropKeys(this.props),
        );
        Scheduler.log(
          'shouldComponentUpdate (next props): ' + getPropKeys(props),
        );
        return true;
      }
      componentDidUpdate(props) {
        Scheduler.log('componentDidUpdate (prev props): ' + getPropKeys(props));
        Scheduler.log(
          'componentDidUpdate (next props): ' + getPropKeys(this.props),
        );
        return true;
      }
      componentDidMount() {
        Scheduler.log('componentDidMount: ' + getPropKeys(this.props));
        return true;
      }
      UNSAFE_componentWillMount() {
        Scheduler.log('componentWillMount: ' + getPropKeys(this.props));
      }
      UNSAFE_componentWillReceiveProps(nextProps) {
        Scheduler.log(
          'componentWillReceiveProps (prev props): ' + getPropKeys(this.props),
        );
        Scheduler.log(
          'componentWillReceiveProps (next props): ' + getPropKeys(nextProps),
        );
      }
      UNSAFE_componentWillUpdate(nextProps) {
        Scheduler.log(
          'componentWillUpdate (prev props): ' + getPropKeys(this.props),
        );
        Scheduler.log(
          'componentWillUpdate (next props): ' + getPropKeys(nextProps),
        );
      }
      componentWillUnmount() {
        Scheduler.log('componentWillUnmount: ' + getPropKeys(this.props));
      }
      render() {
        return <Text text={'render: ' + getPropKeys(this.props)} />;
      }
    }

Frequently Asked Questions

What is the Component class?
Component is a class in the react codebase, defined in packages/react-reconciler/src/__tests__/ReactClassComponentPropResolution-test.js.
Where is Component defined?
Component is defined in packages/react-reconciler/src/__tests__/ReactClassComponentPropResolution-test.js at line 41.

Analyze Your Own Codebase

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

Try Supermodel Free