-
[React] Warning: You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.
2022. 11. 8.
반응형에러 내용
더보기Warning: You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.
에러 이유
- input의 'value'값이 유동적으로 변하는 경우 readOnly 속성을 추가해 주거나 value를 'defaultValue'로 바꾸어 사용해야 한다.
해결
value 속성을 defaultValue로 바꾸어 줌
반응형'Error' 카테고리의 다른 글
[React] cross-env: command not found (0) 2023.03.28 [React] Warning: Each child in a list should have a unique "key" prop. (0) 2022.11.09 [파일질라] 서버 연결 실패 오류 (2) 2022.11.07 [React] Warning: validateDOMNesting(...): div cannot appear as a child of table. (0) 2022.11.07 댓글