Home / Function/ Counter() — react Function Reference

Counter() — react Function Reference

Architecture documentation for the Counter() function in use-state.e2e.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  4032a9a7_954b_b73b_155f_537669bd85f6["Counter()"]
  5e899cb6_3612_413e_1a29_a9aab42c7271["use-state.e2e.js"]
  4032a9a7_954b_b73b_155f_537669bd85f6 -->|defined in| 5e899cb6_3612_413e_1a29_a9aab42c7271
  style 4032a9a7_954b_b73b_155f_537669bd85f6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/e2e/use-state.e2e.js lines 13–24

function Counter() {
  let [state, setState] = useState(0);
  return (
    <div>
      <Title text="Counter" />
      <span>{state}</span>
      <button data-testid="button" onClick={() => setState(state + 1)}>
        increment
      </button>
    </div>
  );
}

Subdomains

Frequently Asked Questions

What does Counter() do?
Counter() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/e2e/use-state.e2e.js.
Where is Counter() defined?
Counter() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/e2e/use-state.e2e.js at line 13.

Analyze Your Own Codebase

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

Try Supermodel Free