Severity: error | Blocks morph build: yes
You nested content inside a Morph component:
error : mx-component-children : component `<Card>` does not accept children in v1
hint: Pass content through a typed prop on `Card` instead of nesting it
Learn more: https://morph.levizr.com/docs/errors/mx-component-childrenComponent tags (capitalized names) are compiled into native instances with a
fixed, typed prop contract. They do not have an implicit children slot.
Empty and comment-only children are allowed because they render nothing:
<Card title="empty"></Card>
<Card title="comment">{/* nothing */}</Card>Native elements (div, text, button, …) own a native child tree, so
nesting inside them is meaningful and supported. A Morph component expands to
its root native node at compile time; there is no runtime container that could
accept arbitrary children without inventing a slot model, reconciliation
rules, and a new value type for pre-built nodes.
Silently dropping nested content would hide real UI, so morph check rejects
it before the build starts. The IR builder enforces the same rule as a second
line of defense.
export function Card() {
return <div>card</div>;
}
export default function App() {
// ❌ Card has no children slot — mx-component-children
return (
<body>
<Card>
<text>nested</text>
</Card>
</body>
);
}Pass the content as data through typed props and render it inside the component:
export function Card(props: { title: string, body: string }) {
return (
<div>
<text>{props.title}</text>
<text>{props.body}</text>
</div>
);
}
export default function App() {
// ✅ Content travels through the component's props contract
return <Card title="Title" body="Details" />;
}If the component needs several content regions, declare one prop per region
(for example header, body, and footer) rather than nesting markup at the
call site.
Steps:
morph check.Do not disable this rule. It marks a v1 contract boundary, not a style
preference; bypassing it only moves the failure to morph build.