Home / File/ ReactCounter.jsx — astro Source File

ReactCounter.jsx — astro Source File

Architecture documentation for ReactCounter.jsx, a javascript file in the astro codebase. 1 imports, 0 dependents.

File javascript E2ETesting TestFixtures 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  1c4b4c40_fa63_4f69_68ec_f7eb09a2e4da["ReactCounter.jsx"]
  d9988dd0_c044_f9d2_85cd_a31a0a2bdf80["react"]
  1c4b4c40_fa63_4f69_68ec_f7eb09a2e4da --> d9988dd0_c044_f9d2_85cd_a31a0a2bdf80
  style 1c4b4c40_fa63_4f69_68ec_f7eb09a2e4da fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { useState } from 'react';

/** a counter written in React */
export function Counter({ children, id }) {
	const [count, setCount] = useState(0);
	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 id={`${id}-count`}>{count}</pre>
			<button id={`${id}-increment`} className="increment" onClick={add}>+</button>
			<div className="children">{children}</div>
		</div>
	);
}

Domain

Subdomains

Functions

Dependencies

  • react

Frequently Asked Questions

What does ReactCounter.jsx do?
ReactCounter.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 ReactCounter.jsx?
ReactCounter.jsx defines 1 function(s): Counter.
What does ReactCounter.jsx depend on?
ReactCounter.jsx imports 1 module(s): react.
Where is ReactCounter.jsx in the architecture?
ReactCounter.jsx is located at packages/astro/e2e/fixtures/nested-in-solid/src/components/react/ReactCounter.jsx (domain: E2ETesting, subdomain: TestFixtures, directory: packages/astro/e2e/fixtures/nested-in-solid/src/components/react).

Analyze Your Own Codebase

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

Try Supermodel Free