• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    해결됨

Encountered two children with the same key 에러..

21.11.08 13:00 작성 조회수 560

0

안녕하세요 무한스크롤 강의를 들은 이후로 이상한 에러가 뜹니다..

index.js:1 Warning: Encountered two children with the same key, `61888dc0bcad5b898380d112`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.

 

다른 페이지에서 다시 홈으로  가면 이런 오류가 포스트마다 뜨네요.. 처음 로드될때 []안해줘서 그런건가요? 왜이러는 거죠?

답변 1

답변을 작성해보세요.

0

영어 그대로 입니다. same key error

다른 페이지갔다가 다시 오면 처음 홈에서 불러왔던 자료들이 깨긋하게 []으로 안날려줘서

다시 홈으로 오니, 또 데이터를 불러오다보니...

같은게 2개(same key)가 있어 에러가 나는 것입니다. 

강의 그대로 적은것인데 저 오류는 못고치나요?

어라? 로드시 posts:[]넣어주니 잘되네용.. 전에는 몇개 짤리길래 빼준거로 기억하는데.. 답변감사합닏다!