forked from mystiq/hydrogen-web
convert string children to text nodes
This commit is contained in:
parent
618c4ffe20
commit
77eeacb09b
1 changed files with 3 additions and 0 deletions
|
@ -12,6 +12,9 @@ export function el(elementName, attrs, children) {
|
|||
if (Array.isArray(children)) {
|
||||
// TODO: use fragment here?
|
||||
for (let c of children) {
|
||||
if (typeof c === "string") {
|
||||
c = text(c);
|
||||
}
|
||||
e.appendChild(c);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue