Home / File/ Counter.tsx — astro Source File

Counter.tsx — astro Source File

Architecture documentation for Counter.tsx, a tsx file in the astro codebase. 2 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  457bc11f_d018_ff26_4102_006c5b6a1bdd["Counter.tsx"]
  4108d377_5481_173e_643f_2da4b55fef28["Counter.css"]
  457bc11f_d018_ff26_4102_006c5b6a1bdd --> 4108d377_5481_173e_643f_2da4b55fef28
  d9988dd0_c044_f9d2_85cd_a31a0a2bdf80["react"]
  457bc11f_d018_ff26_4102_006c5b6a1bdd --> d9988dd0_c044_f9d2_85cd_a31a0a2bdf80
  style 457bc11f_d018_ff26_4102_006c5b6a1bdd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { useState } from 'react';
import './Counter.css';

export default function Counter({
	children,
	count: initialCount,
}: {
	children: JSX.Element;
	count: number;
}) {
	const [count, setCount] = useState(initialCount);
	const add = () => setCount((i) => i + 1);
	const subtract = () => setCount((i) => i - 1);

	return (
		<>
			<div className="counter">
				<button onClick={subtract}>-</button>
				<pre>{count}</pre>
				<button onClick={add}>+</button>
			</div>
			<div className="counter-message">{children}</div>
		</>
	);
}

Subdomains

Functions

Dependencies

Frequently Asked Questions

What does Counter.tsx do?
Counter.tsx is a source file in the astro codebase, written in tsx. It belongs to the IntegrationAdapters domain, ReactIntegration subdomain.
What functions are defined in Counter.tsx?
Counter.tsx defines 1 function(s): Counter.
What does Counter.tsx depend on?
Counter.tsx imports 2 module(s): Counter.css, react.
Where is Counter.tsx in the architecture?
Counter.tsx is located at packages/astro/test/fixtures/css-deduplication/src/components/Counter.tsx (domain: IntegrationAdapters, subdomain: ReactIntegration, directory: packages/astro/test/fixtures/css-deduplication/src/components).

Analyze Your Own Codebase

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

Try Supermodel Free