Severity: error | Blocks morph build: yes
You passed a prop to a component that does not declare it:
error : mx-component-prop : Unknown prop `titel` on `<Hero>`
hint: `Hero` declares: title, onPress
Learn more: https://morph.levizr.com/docs/errors/mx-component-propA special case is a component that declares no props at all but receives
one: `<Hero>` takes no props but got `title`.
Component props are bound at compile time to typed C++ parameters. An unknown
prop has no parameter to bind to — silently dropping it would hide typos
(titel vs title) and make refactors (renaming a prop) silently break every
call site. Morph rejects the call so renames fail loudly and exactly where the
stale prop is passed.
key is never treated as a prop: it is consumed by list reconciliation and is
excluded from this check.
export function Hero(props: { title: string }) {
return <div>{props.title}</div>;
}
export default function App() {
// ❌ `titel` is not declared on Hero — mx-component-prop
return <Hero titel="hi" />;
}export function Badge() {
return <div>new</div>;
}
export default function App() {
// ❌ Badge takes no props — mx-component-prop
return <Badge label="new" />;
}Either fix the call site or declare the prop — decide which side is wrong:
// ✅ Fix 1: correct the typo at the call site
export default function App() {
return <Hero title="hi" />;
}// ✅ Fix 2: declare the prop the call site needs
export function Hero(props: { title: string, subtitle?: string }) {
return (
<div>
{props.title} {props.subtitle}
</div>
);
}Steps:
? when not every caller passes it).morph check.Do not disable this rule. It is the main safety net for component refactors — disabling it turns every prop rename into silent dead UI.