Support null and undefined in JrxNode type

Split JrxNode into JrxElement (concrete branded object) and JrxNode
(JrxElement | null | undefined), mirroring React's ReactElement vs
ReactNode pattern. Components can now return null/undefined to render
nothing.

- Rename isJrxNode to isJrxElement (deprecated alias kept)
- Handle null-returning components in jsx/jsxs factories
- Add tests for null/undefined returns, children filtering, render()
  rejection

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2026-03-14 01:06:22 +00:00
parent 00a5e83e8b
commit 4dcd184de0
6 changed files with 126 additions and 58 deletions

View File

@@ -1,3 +1,3 @@
export { render } from "./render";
export { isJrxNode, JRX_NODE, FRAGMENT } from "./types";
export type { JrxNode, JrxComponent, RenderOptions } from "./types";
export { isJrxElement, isJrxNode, JRX_NODE, FRAGMENT } from "./types";
export type { JrxElement, JrxNode, JrxComponent, RenderOptions } from "./types";