При работе с typescript, react, файлами TSX и объявлениями definitely typed компиляция выдаёт такую ошибку:
error TS2339: Property 'for' does not exist on type 'HTMLProps<HTMLLabelElement>'.
Это происходит при компиляции компонента со следующим TSX
<label for={this.props.fieldId} className="field-caption">{this.props.caption}</label>
Я уже исправил проблему, но оставлю решение для тех, кто столкнётся с ней позже, поскольку ни Google, ни StackOverflow не помогли найти ответ
Переведено с английского·Показать оригиналWith typescript, react, TSX source files and definitely typed declarations, compilation gives me this error:
error TS2339: Property 'for' does not exist on type 'HTMLProps<HTMLLabelElement>'.
It happens while compiling a component containing this TSX
<label for={this.props.fieldId} className="field-caption">{this.props.caption}</label>
I've fixed it already, but I'm posting this for whoever encounters it next because neither Google nor StackOverflow searches turned up the answer