Skip to content

Commit

Permalink
chore(astro): update polymorphic element name for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano committed Jul 3, 2024
1 parent b1f1b2d commit dc34eb8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import { customAlphabet, urlAlphabet } from "nanoid";
const safeId = customAlphabet(urlAlphabet, 10)();
const { as: Element = 'button', id = safeId, ...props } = Astro.props
const { as: Tag = 'button', id = safeId, ...props } = Astro.props
---

<Element id={id}>
<Tag id={id}>
<slot />
</Element >
</Tag >

<script is:inline define:vars={{ props, safeId }}>
const btn = document.querySelector(`#${safeId}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { customAlphabet, urlAlphabet } from "nanoid";
const safeId = customAlphabet(urlAlphabet, 10)();
const { as: Element = 'button', id = safeId, ...props } = Astro.props
const { as: Tag = 'button', id = safeId, ...props } = Astro.props
---

<Element id={id}>
<Tag id={id}>
<slot />
</Element >
</Tag >

<script is:inline define:vars={{ props, safeId }}>
const btn = document.querySelector(`#${safeId}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import { customAlphabet, urlAlphabet } from "nanoid";
const safeId = customAlphabet(urlAlphabet, 10)();
const { as: Element = 'button', id = safeId, ...props } = Astro.props
const { as: Tag = 'button', id = safeId, ...props } = Astro.props
---

<Element id={id}>
<Tag id={id}>
<slot />
</Element >
</Tag >

<script is:inline define:vars={{ props, safeId }}>
const btn = document.querySelector(`#${safeId}`);
Expand Down

0 comments on commit dc34eb8

Please sign in to comment.