Counter Class — react Architecture
Architecture documentation for the Counter class in index.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 92a36f15_f1ab_53ba_9183_f8e4e9157adc["Counter"] 07b9c275_1fa4_3ff8_2032_c903ffd49789["index.js"] 92a36f15_f1ab_53ba_9183_f8e4e9157adc -->|defined in| 07b9c275_1fa4_3ff8_2032_c903ffd49789 b9bab808_5aef_978d_931c_291140ba6258["onCommit()"] 92a36f15_f1ab_53ba_9183_f8e4e9157adc -->|method| b9bab808_5aef_978d_931c_291140ba6258 930dcc0b_5908_a931_0cbf_f0a5eb05b26a["componentDidMount()"] 92a36f15_f1ab_53ba_9183_f8e4e9157adc -->|method| 930dcc0b_5908_a931_0cbf_f0a5eb05b26a 30947f5e_f7a6_2551_6a7b_d6a45c938480["componentDidUpdate()"] 92a36f15_f1ab_53ba_9183_f8e4e9157adc -->|method| 30947f5e_f7a6_2551_6a7b_d6a45c938480 a7a5955e_6f9b_2376_f95d_693d7b67d9de["render()"] 92a36f15_f1ab_53ba_9183_f8e4e9157adc -->|method| a7a5955e_6f9b_2376_f95d_693d7b67d9de
Relationship Graph
Source Code
fixtures/expiration/src/index.js lines 4–22
class Counter extends React.unstable_AsyncComponent {
state = {counter: 0};
onCommit() {
setImmediate(() => {
this.setState(state => ({
counter: state.counter + 1,
}));
});
}
componentDidMount() {
this.onCommit();
}
componentDidUpdate() {
this.onCommit();
}
render() {
return <h1>{this.state.counter}</h1>;
}
}
Defined In
Source
Frequently Asked Questions
What is the Counter class?
Counter is a class in the react codebase, defined in fixtures/expiration/src/index.js.
Where is Counter defined?
Counter is defined in fixtures/expiration/src/index.js at line 4.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free