WIP controls

This commit is contained in:
Tangent 2024-01-13 00:29:49 -05:00
parent fe121a40ab
commit 5cc40ef764
2 changed files with 27 additions and 8 deletions

View file

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