Counter() — astro Function Reference
Architecture documentation for the Counter() function in Counter.jsx from the astro codebase.
Entity Profile
Dependency Diagram
graph TD fdb58c18_fbc8_1c9b_9866_63c804811416["Counter()"] 53555133_e38d_0a4d_1088_d1ddbcf576ed["Counter.jsx"] fdb58c18_fbc8_1c9b_9866_63c804811416 -->|defined in| 53555133_e38d_0a4d_1088_d1ddbcf576ed style fdb58c18_fbc8_1c9b_9866_63c804811416 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/test/fixtures/component-library-shared/Counter.jsx lines 5–20
export default function Counter({ children }) {
const [count, setCount] = useState(0);
const add = () => setCount((i) => i + 1);
const subtract = () => setCount((i) => i - 1);
return (
<>
<div class="counter">
<button onClick={subtract}>-</button>
<pre>{count}</pre>
<button onClick={add}>+</button>
</div>
<div class="counter-message">{children}</div>
</>
);
}
Domain
Subdomains
Source
Frequently Asked Questions
What does Counter() do?
Counter() is a function in the astro codebase, defined in packages/astro/test/fixtures/component-library-shared/Counter.jsx.
Where is Counter() defined?
Counter() is defined in packages/astro/test/fixtures/component-library-shared/Counter.jsx at line 5.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free