React · Junior · Question 60 of 75
Must key values be unique across the whole app?
- ✓Correct answer: No - only among siblings in the same list
- 2Yes, globally unique like DOM
ids - 3Yes, within the whole component
Explanation
Two different lists can reuse the same ids as keys. key isn't passed to the component as a prop; pass the id separately if the child needs it.