Invalid DOM property `for`

Creating the dots·2021년 11월 6일
0

project-2-느린우체통

목록 보기
10/10

위와같은 에러가 발생한 이유는 jsx 문법에서 for는 반복문을 의미하기 때문에, 에러문에서 알려주는 것처럼 label 태그 안의 for를 htmlFor로 변경해주면 된다.

 <label htmlFor="receiver">
            받는사람
            <label htmlFor="tome" className="checkbox-tome">
              <input name="tome" type="checkbox" />
              내게쓰기
            </label>
            <input
              type="email"
              name="receiver"
              placeholder="수신이메일을 작성해주세요"
              className="Mailinfo-input"
              value={emailInfo.receiver}
              onChange={handleChange}
            />
</label>
profile
어제보다 나은 오늘을 만드는 중

0개의 댓글