diff --git a/deno_dist/middleware/jsx/jsx-dev-runtime.ts b/deno_dist/middleware/jsx/jsx-dev-runtime.ts index f1e8cc11..f041637d 100644 --- a/deno_dist/middleware/jsx/jsx-dev-runtime.ts +++ b/deno_dist/middleware/jsx/jsx-dev-runtime.ts @@ -4,7 +4,7 @@ import type { JSXNode } from './index.ts' export { Fragment } from './index.ts' export function jsxDEV(tag: string | Function, props: Record): JSXNode { - const children = (props.children ?? []) as (string | HtmlEscapedString) + const children = (props.children ?? []) as string | HtmlEscapedString delete props['children'] - return jsx(tag, props, children) + return Array.isArray(children) ? jsx(tag, props, ...children) : jsx(tag, props, children) } diff --git a/src/middleware/jsx/jsx-dev-runtime.ts b/src/middleware/jsx/jsx-dev-runtime.ts index 5e0cb11f..1ede3e8c 100644 --- a/src/middleware/jsx/jsx-dev-runtime.ts +++ b/src/middleware/jsx/jsx-dev-runtime.ts @@ -4,7 +4,7 @@ import type { JSXNode } from '.' export { Fragment } from '.' export function jsxDEV(tag: string | Function, props: Record): JSXNode { - const children = (props.children ?? []) as (string | HtmlEscapedString) + const children = (props.children ?? []) as string | HtmlEscapedString delete props['children'] - return jsx(tag, props, children) + return Array.isArray(children) ? jsx(tag, props, ...children) : jsx(tag, props, children) } diff --git a/tsconfig.json b/tsconfig.json index 214f5a6b..e70c66e9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -24,6 +24,7 @@ "include": [ "src/**/*.ts", "src/**/*.mts", - "src/**/*.test.ts" + "src/**/*.test.ts", + "src/**/*.test.tsx" ], } \ No newline at end of file