Counter.jsx — astro Source File
Architecture documentation for Counter.jsx, a javascript file in the astro codebase. 4 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 1cff5a89_304f_5d58_30e4_07a283fac963["Counter.jsx"] 2322a1ae_d580_2d0d_eadc_4dd40766e4c8["Counter.css"] 1cff5a89_304f_5d58_30e4_07a283fac963 --> 2322a1ae_d580_2d0d_eadc_4dd40766e4c8 0fef379e_25c0_6f95_11fd_6d0f7db42b7e["preact"] 1cff5a89_304f_5d58_30e4_07a283fac963 --> 0fef379e_25c0_6f95_11fd_6d0f7db42b7e cab470d1_415a_91cc_cdb3_49d91c033a90["compat"] 1cff5a89_304f_5d58_30e4_07a283fac963 --> cab470d1_415a_91cc_cdb3_49d91c033a90 c842527d_3bf8_8183_b0c5_b57319266e7f["hooks"] 1cff5a89_304f_5d58_30e4_07a283fac963 --> c842527d_3bf8_8183_b0c5_b57319266e7f style 1cff5a89_304f_5d58_30e4_07a283fac963 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { Fragment, h } from 'preact';
import { Suspense, lazy } from 'preact/compat';
import { useState } from 'preact/hooks';
import './Counter.css';
const LazyCounterMessage = lazy(() => import('./CounterMessage'))
export default function Counter({ children, count: initialCount, id }) {
const [count, setCount] = useState(initialCount);
const add = () => setCount((i) => i + 1);
const subtract = () => setCount((i) => i - 1);
return (
<>
<div id={id} className="counter">
<button className="decrement" onClick={subtract}>-</button>
<pre>{count}</pre>
<button className="increment" onClick={add}>+</button>
</div>
<Suspense fallback={<p>Load message...</p>}>
<LazyCounterMessage className="counter-message">{children}</LazyCounterMessage>
</Suspense>
</>
);
}
Domain
Subdomains
Functions
Dependencies
- Counter.css
- compat
- hooks
- preact
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 E2ETesting domain, TestFixtures subdomain.
What functions are defined in Counter.jsx?
Counter.jsx defines 2 function(s): Counter, LazyCounterMessage.
What does Counter.jsx depend on?
Counter.jsx imports 4 module(s): Counter.css, compat, hooks, preact.
Where is Counter.jsx in the architecture?
Counter.jsx is located at packages/astro/e2e/fixtures/preact-lazy-component/src/components/Counter.jsx (domain: E2ETesting, subdomain: TestFixtures, directory: packages/astro/e2e/fixtures/preact-lazy-component/src/components).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free