Home / Function/ default.setup() — astro Function Reference

default.setup() — astro Function Reference

Architecture documentation for the default.setup() function in Counter.jsx from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  b8217175_ab10_1a82_5469_bd5d680fb13d["default.setup()"]
  fccdbd05_3743_eb10_60cd_0d5e73b1517e["Counter.jsx"]
  b8217175_ab10_1a82_5469_bd5d680fb13d -->|defined in| fccdbd05_3743_eb10_60cd_0d5e73b1517e
  style b8217175_ab10_1a82_5469_bd5d680fb13d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/test/fixtures/vue-jsx/src/components/Counter.jsx lines 14–27

  setup(props) {
    const count = ref(parseInt(props.start))
    const stepSize = ref(parseInt(props.stepSize))
    const add = () => (count.value = count.value + stepSize.value);
    const subtract = () => (count.value = count.value - stepSize.value);
    return () => (
      <div class="counter">
        <h1><slot /></h1>
        <button onClick={subtract}>-</button>
        <pre>{count.value}</pre>
        <button onClick={add}>+</button>
      </div>
    )
  },

Subdomains

Frequently Asked Questions

What does default.setup() do?
default.setup() is a function in the astro codebase, defined in packages/astro/test/fixtures/vue-jsx/src/components/Counter.jsx.
Where is default.setup() defined?
default.setup() is defined in packages/astro/test/fixtures/vue-jsx/src/components/Counter.jsx at line 14.

Analyze Your Own Codebase

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

Try Supermodel Free