MockComponent Class — react Architecture
Architecture documentation for the MockComponent class in ReactUpdates-test.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD add35859_8a8f_31a9_649d_7217f9bd2e68["MockComponent"] e1a7562e_ea2b_594b_d7d2_0ca836dcd888["ReactUpdates-test.js"] add35859_8a8f_31a9_649d_7217f9bd2e68 -->|defined in| e1a7562e_ea2b_594b_d7d2_0ca836dcd888 9df8750a_f193_2168_acfb_b063315f0baf["render()"] add35859_8a8f_31a9_649d_7217f9bd2e68 -->|method| 9df8750a_f193_2168_acfb_b063315f0baf 6ed82db3_e9e8_fa45_435c_2761e869eb84["componentDidMount()"] add35859_8a8f_31a9_649d_7217f9bd2e68 -->|method| 6ed82db3_e9e8_fa45_435c_2761e869eb84
Relationship Graph
Source Code
packages/react-dom/src/__tests__/ReactUpdates-test.js lines 813–831
class MockComponent extends React.Component {
render() {
updates.push(this.props.depth);
return <div />;
}
componentDidMount() {
instances.push(this);
if (this.props.depth < this.props.count) {
const root = ReactDOMClient.createRoot(findDOMNode(this));
root.render(
<MockComponent
depth={this.props.depth + 1}
count={this.props.count}
/>,
);
}
}
}
Source
Frequently Asked Questions
What is the MockComponent class?
MockComponent is a class in the react codebase, defined in packages/react-dom/src/__tests__/ReactUpdates-test.js.
Where is MockComponent defined?
MockComponent is defined in packages/react-dom/src/__tests__/ReactUpdates-test.js at line 813.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free