PreactCounter.tsx — astro Source File
Architecture documentation for PreactCounter.tsx, a tsx file in the astro codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR ef31a2a7_465a_a7f3_7ee2_eaf1a9ef0492["PreactCounter.tsx"] c842527d_3bf8_8183_b0c5_b57319266e7f["hooks"] ef31a2a7_465a_a7f3_7ee2_eaf1a9ef0492 --> c842527d_3bf8_8183_b0c5_b57319266e7f style ef31a2a7_465a_a7f3_7ee2_eaf1a9ef0492 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { useState } from 'preact/hooks';
/** a counter written in Preact */
export function PreactCounter({ children, id }) {
const [count, setCount] = useState(0);
const add = () => setCount((i) => i + 1);
const subtract = () => setCount((i) => i - 1);
return (
<div id={id} class="counter">
<button class="decrement" onClick={subtract}>-</button>
<pre>{count}</pre>
<button class="increment" onClick={add}>+</button>
<div class="children">{children}</div>
</div>
);
}
Domain
Subdomains
Functions
Dependencies
- hooks
Source
Frequently Asked Questions
What does PreactCounter.tsx do?
PreactCounter.tsx is a source file in the astro codebase, written in tsx. It belongs to the E2ETesting domain, TestFixtures subdomain.
What functions are defined in PreactCounter.tsx?
PreactCounter.tsx defines 1 function(s): PreactCounter.
What does PreactCounter.tsx depend on?
PreactCounter.tsx imports 1 module(s): hooks.
Where is PreactCounter.tsx in the architecture?
PreactCounter.tsx is located at packages/astro/e2e/fixtures/error-cyclic/src/components/PreactCounter.tsx (domain: E2ETesting, subdomain: TestFixtures, directory: packages/astro/e2e/fixtures/error-cyclic/src/components).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free