A component is changing a controlled input of type text to be uncontrolled 에러

Hyun·2022년 3월 6일
0

A component is changing a controlled input of type text to be uncontrolled. Input elements should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component.

input 의 value에 undefined 가 들어갔을 경우에 대한 처리가 없기 때문에 발생

=> input 의 value 가 undefined 일 때를 방지하기 위해 초기값을 설정한다

value={value|| ''}

stackoverflow.com/questions/47012169/a

profile
better than yesterday

0개의 댓글