Rules
no-missing-key
Full Name in eslint-plugin-react-x
Full Name in @eslint-react/eslint-plugin
Features
π
Presets
core
recommended
recommended-typescript
recommended-type-checked
What it does
Prevents missing key
on items in list rendering.
React needs keys to identify items in the list. If you donβt specify a key, React will use the array index as a key, which often leads to subtle and confusing bugs.
Examples
Failing
Passing
Implementation
Further Reading
See Also
no-duplicate-key
Prevents duplicatekey
on elements in the same array or a list ofchildren
.no-implicit-key
Preventskey
from not being explicitly specified (e.g. spreadingkey
from objects).no-array-index-key
Warns when an arrayindex
is used as akey
prop.