syntax
syntax copied to clipboard
Mistyping @react.component yields confusing error message
module Button = {
@react.componentt
let make = (~count: int) => {
<button> {count->React.int} </button>
}
}
let make = () => <Button count=3 />
yields this error at the call site
This has type: (~count: int) => React.element
Somewhere wanted: React.component<'a> (defined as 'a => React.element)
I would have expected a warning about an unused annotation or something similar.