codestates / codestates/LearnRegex
[👾 ErrorLog] input 태그 value 설정
- Lingua principale
- JavaScript
- Stelle
- 2
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
어떤 에러인가?
* input value의 값을 상태(result)로 주려고 함. 상태의 초기값을 로컬 스토리지로 잡았으나 로컬 스토리지가 비어있을 경우 undefined가 초기값이 됨
에러 메시지
* input의 value에 undefined가 들어올 경우에 대한 처리가 없다는 경고다
```js
Warning: 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: https://reactjs.org/link/controlled-components
```
에러 해결 방법
* value의 값이 undefined 일 때 빈 문자열이 들어갈 수 있도록 함
```js
```
에러 해결을 위해 참고한 레퍼런스 링크
* https://yeondube.tistory.com/74
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.