Closed
Description
TypeScript Version: 3.5.1
Search Terms: jsx, dash, props
Code
declare namespace JSX {
interface ElementAttributesProperty {
props: any;
}
}
class MyComponent {
props: {
foo?: string;
}
}
// OK
const el1 = <MyComponent foo="bar" />;
// OK, fooBar is incorrect prop
const el2 = <MyComponent fooBar="bar" />;
// Not OK, foo-bar is incorrect prop, but not reported
const el3 = <MyComponent foo-bar="bar" />;
Expected behavior:
Expected error on el3
.
Actual behavior:
No error on el3
.