-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Description
Conclusion - https://medium.com/@adhithiravi/why-do-i-need-keys-in-react-lists-dbb522188bbb
Let’s recap the highlights from this post.
- Lists are performant heavy and need to be used carefully.
- Make sure every item in the list has a unique key.
- It is prefered to not use indexes as a key unless you know for sure that the list is a static list (no additions/re-ordering/removal to the list).
- Never use unstable keys like Math.random() to generate a key.
- React will run into performance degradation and unexpected behaviour if unstable keys are used
.
Metadata
Metadata
Assignees
Labels
No labels