Counter.jsx — astro Source File
Architecture documentation for Counter.jsx, a javascript file in the astro codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 93bf0ea8_d4ce_4455_efa5_f6971e255187["Counter.jsx"] c842527d_3bf8_8183_b0c5_b57319266e7f["hooks"] 93bf0ea8_d4ce_4455_efa5_f6971e255187 --> c842527d_3bf8_8183_b0c5_b57319266e7f style 93bf0ea8_d4ce_4455_efa5_f6971e255187 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { useState } from 'preact/hooks';
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
Functions
Dependencies
- hooks
Source
Frequently Asked Questions
What does Counter.jsx do?
Counter.jsx is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What functions are defined in Counter.jsx?
Counter.jsx defines 1 function(s): Counter.
What does Counter.jsx depend on?
Counter.jsx imports 1 module(s): hooks.
Where is Counter.jsx in the architecture?
Counter.jsx is located at examples/with-mdx/src/components/Counter.jsx (domain: CoreAstro, subdomain: RenderingEngine, directory: examples/with-mdx/src/components).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free