Home / Class/ MockComponent Class — react Architecture

MockComponent Class — react Architecture

Architecture documentation for the MockComponent class in ReactLegacyUpdates-test.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  b15ecac2_fc62_9b70_621c_fb1ca420f284["MockComponent"]
  57bbe153_3647_1eae_6c86_4e9ee333eae2["ReactLegacyUpdates-test.js"]
  b15ecac2_fc62_9b70_621c_fb1ca420f284 -->|defined in| 57bbe153_3647_1eae_6c86_4e9ee333eae2
  0107956b_86bf_fee9_bd72_e77be1cc332f["render()"]
  b15ecac2_fc62_9b70_621c_fb1ca420f284 -->|method| 0107956b_86bf_fee9_bd72_e77be1cc332f
  16075634_9586_ced9_61a2_e36dcc41b76f["componentDidMount()"]
  b15ecac2_fc62_9b70_621c_fb1ca420f284 -->|method| 16075634_9586_ced9_61a2_e36dcc41b76f

Relationship Graph

Source Code

packages/react-dom/src/__tests__/ReactLegacyUpdates-test.js lines 693–711

    class MockComponent extends React.Component {
      render() {
        updates.push(this.props.depth);
        return <div />;
      }

      componentDidMount() {
        instances.push(this);
        if (this.props.depth < this.props.count) {
          ReactDOM.render(
            <MockComponent
              depth={this.props.depth + 1}
              count={this.props.count}
            />,
            findDOMNode(this),
          );
        }
      }
    }

Frequently Asked Questions

What is the MockComponent class?
MockComponent is a class in the react codebase, defined in packages/react-dom/src/__tests__/ReactLegacyUpdates-test.js.
Where is MockComponent defined?
MockComponent is defined in packages/react-dom/src/__tests__/ReactLegacyUpdates-test.js at line 693.

Analyze Your Own Codebase

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

Try Supermodel Free