Home / File/ PreactCounter.tsx — astro Source File

PreactCounter.tsx — astro Source File

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

Entity Profile

Dependency Diagram

graph LR
  71e64b7f_4f23_ceb2_ff74_57cd02ca54a8["PreactCounter.tsx"]
  0fef379e_25c0_6f95_11fd_6d0f7db42b7e["preact"]
  71e64b7f_4f23_ceb2_ff74_57cd02ca54a8 --> 0fef379e_25c0_6f95_11fd_6d0f7db42b7e
  c842527d_3bf8_8183_b0c5_b57319266e7f["hooks"]
  71e64b7f_4f23_ceb2_ff74_57cd02ca54a8 --> c842527d_3bf8_8183_b0c5_b57319266e7f
  style 71e64b7f_4f23_ceb2_ff74_57cd02ca54a8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { Fragment, h } from 'preact';
import { useState } from 'preact/hooks';

/** a counter written in Preact */
export default function PreactCounter() {
  const [count, setCount] = useState(0);
  const add = () => setCount((i) => i + 1);
  const subtract = () => setCount((i) => i - 1);

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

Subdomains

Functions

Dependencies

  • hooks
  • preact

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

Analyze Your Own Codebase

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

Try Supermodel Free