WIP controls
This commit is contained in:
parent
fe121a40ab
commit
5cc40ef764
2 changed files with 27 additions and 8 deletions
lib
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue