Why doesn't TypeScript check attributes with a hyphen in the name?
declare namespace JSX {
interface ElementAttributesProperty {
props:any; // specify the property name to use
}
}
class A{
props!:{p1:string}
}
const tsx = <A p1="" p-p2={1} p3=""></A>
p1, is correct as it has a string value.
p-p2, incorrect, it's not defined in the class's props, but there is no TypeScript error.
p3, correct, it's not defined in the class's props and throws a TypeScript error.
Why doesn't TypeScript check p-p2?