/
githubmirror
/
tabler
Обзор
Документация
Войти
/
githubmirror
/
tabler
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
shared/ui/FormHint.astro
21 строка
592 B
Bartosz-Do
Fix all `pnpm type-check` warnings and restore lost `Props` typing (#2805)
08 авг 2026, 18:35
Не верифицирован
08 авг 2026, 18:35
0085eeb
Код
Авторство
О чём код?
--- import type { HTMLTag } from 'astro/types' // Form hint text (.form-hint). // `as` must stay out of the Props body: Astro's frontmatter scanner bails on a member // literally named `as` and silently falls back to untyped props. type PolymorphicProps = { as?: HTMLTag } interface Props extends PolymorphicProps { class?: string /** id so a control can reference the hint via aria-describedby */ id?: string | undefined } const { as: Tag = 'div', class: className, id }: Props = Astro.props --- <Tag class:list={['form-hint', className]} {...id ? { id } : {}}> <slot /> </Tag>