tea라는 state를
let [tea, setTea] = useState(['1', '2', '3', '4', '5']);
이런식으로 만든 뒤에 map 함수로 돌리려고 했는데 자꾸 에러가 뜹니다.
Warning: Encountered two children with the same key, { i }
. Keys should be unique so that components maintain their identity across updates.
이 글을 봐서는 i에 받는 children이 두개 이상이라는 뜻 같은데 제가 쓴 map 함수는 단 한개뿐이라 모르겠습니다.
제 코드를 우선 첨부해드리겠습니다.