[디버깅] Error: input is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.
Web/React
2021. 5. 11. 13:32
Error: input is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`. - styled-component 사용 시 발생하는 문제로, input 등과 같이 자식을 가질 수 없는 태그에 자식을 넣었을 때 발생하는 에러이다. - 해결책: 안에 값을 제거해준다. - 기존에는 잘 몰라서 input 내에 label을 넣어줬다가, 해당 오류가 생겼기 때문에 하고 아래에 로 작성해줬다.