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