Props optional for h

This commit is contained in:
Tangent Wantwight 2024-01-23 23:27:41 -05:00
parent 9d01489c95
commit 461a33e467
1 changed files with 1 additions and 1 deletions

View File

@ -1,6 +1,6 @@
export function h<Name extends keyof HTMLElementTagNameMap>(
name: Name,
props: Partial<HTMLElementTagNameMap[Name]>,
props: Partial<HTMLElementTagNameMap[Name]> = {},
...children: (Node | string)[]
): HTMLElementTagNameMap[Name] {
const element = Object.assign(document.createElement(name), props);