Home / Class/ App Class — react Architecture

App Class — react Architecture

Architecture documentation for the App class in ReactIncrementalUpdates-test.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  7ef4f7c9_c41b_51fd_32f8_867032830d89["App"]
  7843bc0e_e8d4_aeec_54e6_87d2f907fd29["ReactIncrementalUpdates-test.js"]
  7ef4f7c9_c41b_51fd_32f8_867032830d89 -->|defined in| 7843bc0e_e8d4_aeec_54e6_87d2f907fd29
  4c86871f_17a0_5d87_bda4_6210bd22c894["componentDidUpdate()"]
  7ef4f7c9_c41b_51fd_32f8_867032830d89 -->|method| 4c86871f_17a0_5d87_bda4_6210bd22c894
  64fb945a_a0b9_aa0f_4160_f2828497570e["render()"]
  7ef4f7c9_c41b_51fd_32f8_867032830d89 -->|method| 64fb945a_a0b9_aa0f_4160_f2828497570e
  20196449_b438_6018_a033_eb7b692a1c2d["getDerivedStateFromProps()"]
  7ef4f7c9_c41b_51fd_32f8_867032830d89 -->|method| 20196449_b438_6018_a033_eb7b692a1c2d

Relationship Graph

Source Code

packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js lines 601–620

    class App extends React.Component {
      state = {log: ''};
      pushToLog = msg => {
        this.setState(prevState => ({log: prevState.log + msg}));
      };
      componentDidUpdate() {
        Scheduler.log('Committed: ' + this.state.log);
        if (this.state.log === 'B') {
          // Right after B commits, schedule additional updates.
          ReactNoop.unstable_runWithPriority(ContinuousEventPriority, () =>
            this.pushToLog('C'),
          );
          this.pushToLog('D');
        }
      }
      render() {
        pushToLog = this.pushToLog;
        return this.state.log;
      }
    }

Frequently Asked Questions

What is the App class?
App is a class in the react codebase, defined in packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js.
Where is App defined?
App is defined in packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js at line 601.

Analyze Your Own Codebase

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

Try Supermodel Free