SimpleComponent Class — react Architecture
Architecture documentation for the SimpleComponent class in ReactComponentLifeCycle-test.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 2e28f5d1_ae1a_e9c1_e434_72a37d45d7fa["SimpleComponent"] a5334318_ba5d_d1e3_5be5_45cbc1076fcf["ReactComponentLifeCycle-test.js"] 2e28f5d1_ae1a_e9c1_e434_72a37d45d7fa -->|defined in| a5334318_ba5d_d1e3_5be5_45cbc1076fcf c0ebfc6c_7b0d_bab1_db40_7964a08a1b47["constructor()"] 2e28f5d1_ae1a_e9c1_e434_72a37d45d7fa -->|method| c0ebfc6c_7b0d_bab1_db40_7964a08a1b47 67731274_dbc6_438a_30de_1c82e332cc1e["getDerivedStateFromProps()"] 2e28f5d1_ae1a_e9c1_e434_72a37d45d7fa -->|method| 67731274_dbc6_438a_30de_1c82e332cc1e 8d27e776_437d_3458_5330_241d6be13f5c["shouldComponentUpdate()"] 2e28f5d1_ae1a_e9c1_e434_72a37d45d7fa -->|method| 8d27e776_437d_3458_5330_241d6be13f5c 30b3c8aa_9584_4942_a36c_61e16e401994["render()"] 2e28f5d1_ae1a_e9c1_e434_72a37d45d7fa -->|method| 30b3c8aa_9584_4942_a36c_61e16e401994
Relationship Graph
Source Code
packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js lines 1310–1332
class SimpleComponent extends React.Component {
constructor(props) {
super(props);
this.state = {
value: props.value,
};
}
static getDerivedStateFromProps(nextProps, prevState) {
if (nextProps.value === prevState.value) {
return null;
}
return {value: nextProps.value};
}
shouldComponentUpdate(nextProps, nextState) {
return nextState.value !== this.state.value;
}
render() {
return <div ref={divRef}>value: {this.state.value}</div>;
}
}
Source
Frequently Asked Questions
What is the SimpleComponent class?
SimpleComponent is a class in the react codebase, defined in packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js.
Where is SimpleComponent defined?
SimpleComponent is defined in packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js at line 1310.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free