codestates / codestates/ThereWeather

[๐Ÿ‘พ Error Handling] 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.

Open
#177 0 comments 0 reactions 0 assignees View on GitHub
error
Dominant language
JavaScript
Stars
0
Forks
3
PR merge metrics
No merged PRs in 30d

Description

## ์–ด๋–ค ์—๋Ÿฌ์ธ๊ฐ€์š”?
- map ์“ธ ๋•Œ key ๊ด€๋ จ ์˜ค๋ฅ˜

## ์—๋Ÿฌ ๋ฉ”์‹œ์ง€
```jsx
index.js:1 Warning: Encountered two children with the same key, `24`. 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.
```

## ์—๋Ÿฌ ํ•ธ๋“ค๋ง ๋ฐฉ๋ฒ•
```jsx
map์“ธ ๋•Œ ์ธ์ž์— idx ์ถ”๊ฐ€ ํ›„ key๋กœ ์‚ฌ์šฉ
```

## ์—๋Ÿฌ ํ•ธ๋“ค๋ง์„ ์œ„ํ•ด ์ฐธ๊ณ ํ•œ ๋ ˆํผ๋Ÿฐ์Šค ๋งํฌ
[์˜ˆ์‹œ1](https://stackoverflow.com/questions/59978815/encountered-two-children-with-the-same-key-1-keys-should-be-unique-so-that-c?rq=1)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.