Skip to content

Type Alias: ChildBlock

ts
type ChildBlock = 
  | Block
  | string
  | number
  | null
  | ReactElement;

Defined in: src/renderer/types.ts:75

Valid children inside a Block.

  • Block — nested component
  • string — text content
  • number — numeric content
  • null — empty slot (skipped during rendering)
  • ReactElementonly when produced by a client/ import. The Vite build transform rewrites imports from src/client/* into callable refs that return Block at runtime; TypeScript still reads the source .tsx and types them as React components, so the result of calling a client component is typed ReactElement but is a Block at runtime. Accepting ReactElement here bridges that gap so users don't need as unknown as Block casts. Raw JSX (<div>hi</div>) or React components imported from outside client/ are accepted at type level but rejected at runtime with a clear error from the tree walker — use a Block factory or a client component instead.

Matterway Assistant SDK Documentation