#460
react-email: unknown component types and children of leaf components are dropped silently
Two cases in @json-render/react-email drop content with no error or warning:
- Unknown component type →
if (!Component) return null(render.tsx#L59). - Children on leaf components (
Text,Heading,Link,Button,Image,Hr,Preview) are ignored, since those components only renderprops.text. A common LLM output likeLink > Imagejust disappears from the HTML.
validateSpec doesn't catch either (it checks missing_child and orphaned_element, but not unknown types or children on leaves).
With LLM-generated specs this is the hardest kind of bug to notice: the email renders fine, just missing pieces. We ended up writing our own validator to catch it.
Proposal: a console.warn in dev for unknown types, and/or a catalog-aware check (e.g. validateSpec(spec, { catalog })) that flags children on components that don't accept them.
Activity
0No activity yet.