blob: d5b046b0bdb3be483803dfd51af755df2030641c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
---
'astro': minor
---
Added `Polymorphic` type helper to `astro/types` to easily create polymorphic components:
```astro
---
import { HTMLTag, Polymorphic } from 'astro/types';
type Props<Tag extends HTMLTag> = Polymorphic<{ as: Tag }>;
const { as: Tag, ...props } = Astro.props;
---
<Tag {...props} />
```
|