최대 1 분 소요

Warning: Encountered two children with the same key

아이디값이 겹쳐서 발생한 문제!
5번까지는 default 로 만들어놓은 거고, useState의 id 기본값을 0번부터 해서 발생한 문제이다.

오타 주의

시간 객체 사용할 때

마지막 날짜를 완벽히 지정하기 위해서는 다음과 같이 객체를 잡아주어야 한다.

const lastDay = new Date(
  curDate.getFullYear(),
  curDate.getMonth() + 1,
  0,
  23,
  59,
  59
).getTime();

태그:

카테고리:

업데이트:

댓글남기기