Home / Function/ PreactCounter() — astro Function Reference

PreactCounter() — astro Function Reference

Architecture documentation for the PreactCounter() function in PreactCounter.tsx from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  6d5dac78_e319_44aa_4882_e968ad3322d6["PreactCounter()"]
  71e64b7f_4f23_ceb2_ff74_57cd02ca54a8["PreactCounter.tsx"]
  6d5dac78_e319_44aa_4882_e968ad3322d6 -->|defined in| 71e64b7f_4f23_ceb2_ff74_57cd02ca54a8
  style 6d5dac78_e319_44aa_4882_e968ad3322d6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/test/fixtures/astro-jsx/src/components/PreactCounter.tsx lines 5–20

export default function PreactCounter() {
  const [count, setCount] = useState(0);
  const add = () => setCount((i) => i + 1);
  const subtract = () => setCount((i) => i - 1);

  return (
    <div id="preact">
      <div className="counter">
        <button onClick={subtract}>-</button>
        <pre>{count}</pre>
        <button onClick={add}>+</button>
      </div>
      <div className="children">Preact</div>
    </div>
  );
}

Subdomains

Frequently Asked Questions

What does PreactCounter() do?
PreactCounter() is a function in the astro codebase, defined in packages/astro/test/fixtures/astro-jsx/src/components/PreactCounter.tsx.
Where is PreactCounter() defined?
PreactCounter() is defined in packages/astro/test/fixtures/astro-jsx/src/components/PreactCounter.tsx at line 5.

Analyze Your Own Codebase

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

Try Supermodel Free