에러노트

[에러노트] A component is changing an uncontrolled input to be controlled. ...

자바칩 프라푸치노 2022. 4. 1. 15:17

[문제발생]

A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: 

 

[원인]

select option에 undefined가 들어가는 문제  때문인듯

 

[해결]

값이 없을 때 '' empty string이 들어가도록 해주기

 

value={value|| ''}
728x90