diff --git a/.changeset/stupid-houses-hammer.md b/.changeset/stupid-houses-hammer.md new file mode 100644 index 0000000..a3ae8d9 --- /dev/null +++ b/.changeset/stupid-houses-hammer.md @@ -0,0 +1,5 @@ +--- +"hono-og": patch +--- + +Fixed nullish JSX. diff --git a/src/utils/toReactNode.ts b/src/utils/toReactNode.ts index 4096123..83ce03c 100644 --- a/src/utils/toReactNode.ts +++ b/src/utils/toReactNode.ts @@ -18,6 +18,7 @@ export function toReactNode< >(jsx_: jsx): returnType { const jsx = jsx_ as Exclude>; + 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;