Skip to content

Commit b392323

Browse files
authored
fix type
1 parent 34345f4 commit b392323

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tagFactory.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const tagFactory = <T extends keyof HTMLElementTagNameMap>(tagName: T) =>
66
(props: HTMLElementAttributeMap[T], ...children: Children): HTMLElementTagNameMap[T] => {
77
const element = document.createElement(tagName)
88

9-
Object.entries(props).forEach(([name, value]) => element.setAttribute(name, value))
9+
Object.entries(props).forEach(([name, value]) => element.setAttribute(name, String(value))) // TODO: class array, css in js
1010

1111
for(const child of children) {
1212
if(child instanceof HTMLElement) {

0 commit comments

Comments
 (0)