Home / File/ Counter.jsx — astro Source File

Counter.jsx — astro Source File

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

Entity Profile

Dependency Diagram

graph LR
  129f5d54_a2c4_1946_f59e_a38de6e597eb["Counter.jsx"]
  5458ee59_7908_bf35_f257_ad630e4e60d7["solid-js"]
  129f5d54_a2c4_1946_f59e_a38de6e597eb --> 5458ee59_7908_bf35_f257_ad630e4e60d7
  style 129f5d54_a2c4_1946_f59e_a38de6e597eb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// Based on reproduction from https://github.com/withastro/astro/issues/6912

import { For, Match, Switch } from 'solid-js';

export default function Counter(props) {
	return (
		<For each={[1, 2, 3, 4]}>
			{(page) => {
				return (
					<Switch>
						<Match when={page % 2 === 0}>
							<button
								onClick={() => {
									console.log(page);
								}}
							>
								even {page}
							</button>
						</Match>
						<Match when={page % 2 === 1}>
							<button
								onClick={() => {
									console.log(page);
								}}
							>
								odd {page}
							</button>
						</Match>
					</Switch>
				);
			}}
		</For>
	);
}

Subdomains

Functions

Dependencies

  • solid-js

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 IntegrationAdapters domain, ReactIntegration subdomain.
What functions are defined in Counter.jsx?
Counter.jsx defines 1 function(s): Counter.
What does Counter.jsx depend on?
Counter.jsx imports 1 module(s): solid-js.
Where is Counter.jsx in the architecture?
Counter.jsx is located at packages/astro/test/fixtures/solid-component/src/components/Counter.jsx (domain: IntegrationAdapters, subdomain: ReactIntegration, directory: packages/astro/test/fixtures/solid-component/src/components).

Analyze Your Own Codebase

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

Try Supermodel Free