Duolith docs

Errors while checking a page

E0116 Props in the wrong place

Message Only a component declares props

Why

A component declares its props once, at the top of its script, as let { title, count = 0 } = props<{ title: string; count?: number }>(). Pages are routes and receive no props.

How to fix it

Unpack props() into names in a component's script, or read the value from state in a page.

In a terminal

duolith explain E0116

Mentioned in