diff --git a/didact.js b/didact.js index 62436f1..76b4491 100644 --- a/didact.js +++ b/didact.js @@ -3,11 +3,13 @@ function createElement(type, props, ...children) { type, props: { ...props, - children: children.map(child => - typeof child === "object" - ? child - : createTextElement(child) - ), + children: children + .flat() + .map(child => + typeof child === "object" + ? child + : createTextElement(child) + ), }, } }