Home / File/ RCounter.jsx — astro Source File

RCounter.jsx — astro Source File

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

Entity Profile

Dependency Diagram

graph LR
  04d569e2_93dc_43f4_a81b_4ea10a9b3c91["RCounter.jsx"]
  d9988dd0_c044_f9d2_85cd_a31a0a2bdf80["react"]
  04d569e2_93dc_43f4_a81b_4ea10a9b3c91 --> d9988dd0_c044_f9d2_85cd_a31a0a2bdf80
  style 04d569e2_93dc_43f4_a81b_4ea10a9b3c91 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { useState } from 'react';

export default function Counter({ children }) {
	const [count, setCount] = useState(0);
	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

  • react

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free