error message
Type 'MutableRefObject<string>' is not assignable to type 'LegacyRef<HTMLInputElement> | undefined'.
Type 'MutableRefObject<string>' is not assignable to type 'RefObject<HTMLInputElement>'.
Types of property 'current' are incompatible.
Type 'string' is not assignable to type 'HTMLInputElement'.
'MutableRefObject<string>' 유형은 'LegacyRef<HTMLInputElement> | undefined' 유형에 할당할 수 없습니다.
'MutableRefObject<string>' 유형은 'RefObject<HTMLInputElement>' 유형에 할당할 수 없습니다.
'current' 속성 유형은 호환되지 않습니다.
'문자열' 유형은 'HTMLInputElement' 유형에 할당할 수 없습니다.
ref 선언
prop 전달
section ref
The error you're encountering is because the ref you're passing to the section element is of type MutableRefObject<HTMLElement | undefined>, but the ref prop expects a RefObject<HTMLElement>, where the current property is HTMLElement | null, not undefined.
'UI > Type' 카테고리의 다른 글
[ React / useState ] 부모에서 자식으로 useState Hook 넘기기 (0) | 2024.09.01 |
---|---|
[ React / Generic ] argument (Feat. unkown) (1) | 2024.09.01 |