diff --git a/src/typed-html/jsx-runtime.ts b/src/typed-html/jsx-runtime.ts
index 8ad1a48..8cf76c2 100644
--- a/src/typed-html/jsx-runtime.ts
+++ b/src/typed-html/jsx-runtime.ts
@@ -38,9 +38,10 @@ function expandLiterals(props: Record) {
}
}
-export function jsx(tag: any, { children, ...props }: { children: JSX.Element }): JSX.Element {
+export function jsx(tag: any, { children, ...props }: { children: JSX.Element | JSX.Element[] }): JSX.Element {
expandLiterals(props);
- return createElement(tag, props, sanitizer(children));
+ const contents = Array.isArray(children) ? children.map(sanitizer) : [sanitizer(children)];
+ return createElement(tag, props, ...contents);
}
export function jsxs(tag: any, { children, ...props }: { children: JSX.Element[] }): JSX.Element {