Home / File/ PreactCounter.tsx — astro Source File

PreactCounter.tsx — astro Source File

Architecture documentation for PreactCounter.tsx, a tsx file in the astro codebase. 1 imports, 0 dependents.

File tsx E2ETesting TestFixtures 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  406bf1a8_d177_5d24_e146_b0bb792d6df7["PreactCounter.tsx"]
  c842527d_3bf8_8183_b0c5_b57319266e7f["hooks"]
  406bf1a8_d177_5d24_e146_b0bb792d6df7 --> c842527d_3bf8_8183_b0c5_b57319266e7f
  style 406bf1a8_d177_5d24_e146_b0bb792d6df7 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 id={`${id}-count`}>{count}</pre>
			<button id={`${id}-increment`} class="increment" onClick={add}>+</button>
			<div class="children">{children}</div>
		</div>
	);
}

Domain

Subdomains

Functions

Dependencies

  • hooks

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/nested-in-preact/src/components/preact/PreactCounter.tsx (domain: E2ETesting, subdomain: TestFixtures, directory: packages/astro/e2e/fixtures/nested-in-preact/src/components/preact).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free