diff --git a/runtime_tests/deno-jsx/jsx.test.tsx b/runtime_tests/deno-jsx/jsx.test.tsx index 6e4580fc6..d4883b507 100644 --- a/runtime_tests/deno-jsx/jsx.test.tsx +++ b/runtime_tests/deno-jsx/jsx.test.tsx @@ -28,6 +28,12 @@ Deno.test('JSX: Fragment', () => { assertEquals(fragment.toString(), '
1
2
') }) +Deno.test('JSX: Empty Fragment', () => { + const Component = () => <>> + const html = = {
- (props: P): HtmlEscapedString | Promise | undefined
displayName?: string | undefined
}
@@ -247,7 +247,10 @@ class JSXFunctionNode extends JSXNode {
children: children.length <= 1 ? children[0] : children,
})
- if (res instanceof Promise) {
+ if (typeof res === 'boolean' || res == null) {
+ // boolean or null or undefined
+ return
+ } else if (res instanceof Promise) {
if (globalContexts.length === 0) {
buffer.unshift('', res)
} else {
@@ -371,11 +374,11 @@ export const memo = Hono is greatHono