Skip to content

Commit

Permalink
fix: nullish jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Mar 14, 2024
1 parent 1af0fca commit 869e316
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/stupid-houses-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hono-og": patch
---

Fixed nullish JSX.
1 change: 1 addition & 0 deletions src/utils/toReactNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export function toReactNode<
>(jsx_: jsx): returnType {
const jsx = jsx_ as Exclude<Child, Promise<string>>;

if (!jsx) return null as returnType;
if (Array.isArray(jsx))
return jsx.map((child) => toReactNode(child)) as returnType;
if (typeof jsx === "string") return jsx as returnType;
Expand Down

0 comments on commit 869e316

Please sign in to comment.