React Warning1 [React.js] Warning: Use the 'defaultValue' or 'value' props on <select> instead of setting 'selected' on <option> Warning Message Warning: Use the 'defaultValue' or 'value' props on instead of setting 'selected' on Warning Message가 발생하는 이유 일반적인 HTML에서 에 기본값을 설정하는 방법은 option 요소 중 하나에 selected 속성을 추가하는 것이다. 하지만 React에서는 다음과 같이 option 태그에 selected를 사용하면 경고가 발생한다. First Second Third 해결방법 select 태그에 defaultValue를 사용해 기본값을 설정할 수 있다. First Second Third 2021. 11. 26. 이전 1 다음 반응형