Counter() — astro Function Reference
Architecture documentation for the Counter() function in Counter.tsx from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 7e37d8f3_ba9c_8f9d_5281_34c4f8005206["Counter()"] 6b6146e5_2ede_fb80_9206_bbf9ea43a015["Counter.tsx"] 7e37d8f3_ba9c_8f9d_5281_34c4f8005206 -->|defined in| 6b6146e5_2ede_fb80_9206_bbf9ea43a015 style 7e37d8f3_ba9c_8f9d_5281_34c4f8005206 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
examples/framework-solid/src/components/Counter.tsx lines 4–19
export default function Counter(props: { children?: JSX.Element }) {
const [count, setCount] = createSignal(0);
const add = () => setCount(count() + 1);
const subtract = () => setCount(count() - 1);
return (
<>
<div class="counter">
<button onClick={subtract}>-</button>
<pre>{count()}</pre>
<button onClick={add}>+</button>
</div>
<div class="counter-message">{props.children}</div>
</>
);
}
Domain
Subdomains
Source
Frequently Asked Questions
What does Counter() do?
Counter() is a function in the astro codebase, defined in examples/framework-solid/src/components/Counter.tsx.
Where is Counter() defined?
Counter() is defined in examples/framework-solid/src/components/Counter.tsx at line 4.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free