Home / Class/ SimpleApp Class — react Architecture

SimpleApp Class — react Architecture

Architecture documentation for the SimpleApp class in shared.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  2e340e4f_fc25_0148_de3a_aba5e54f7ddb["SimpleApp"]
  5307ca48_73ed_9094_d124_b0724b52c950["shared.js"]
  2e340e4f_fc25_0148_de3a_aba5e54f7ddb -->|defined in| 5307ca48_73ed_9094_d124_b0724b52c950
  7e935781_20c3_a069_5200_463cd6d9c1dc["render()"]
  2e340e4f_fc25_0148_de3a_aba5e54f7ddb -->|method| 7e935781_20c3_a069_5200_463cd6d9c1dc

Relationship Graph

Source Code

fixtures/devtools/regression/shared.js lines 271–292

class SimpleApp extends React.Component {
  state = {count: 0};
  incrementCount = () => {
    const updaterFn = prevState => ({count: prevState.count + 1});
    trace('Updating count', performance.now(), () => this.setState(updaterFn));
  };
  render() {
    const {count} = this.state;
    return (
      <div>
        {count % 2 === 0 ? (
          <span>
            count: {count} <Even />
          </span>
        ) : (
          <span>count: {count}</span>
        )}{' '}
        <button onClick={this.incrementCount}>increment</button>
      </div>
    );
  }
}

Frequently Asked Questions

What is the SimpleApp class?
SimpleApp is a class in the react codebase, defined in fixtures/devtools/regression/shared.js.
Where is SimpleApp defined?
SimpleApp is defined in fixtures/devtools/regression/shared.js at line 271.

Analyze Your Own Codebase

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

Try Supermodel Free