Skip to content

Files

Latest commit

 

History

History
20 lines (13 loc) · 420 Bytes

jsx-key.md

File metadata and controls

20 lines (13 loc) · 420 Bytes

Pattern: Missing key prop for element

Issue: -

Description

Warns for missing key props in JSX element array literals and inside return statements of Array.prototype.map callbacks.

Example of incorrect code:

[1, 2, 3].map(function(x) { return <App /> });
                                   ~~~~~~~

Example of correct code:

[1, 2, 3].map(function(x) { return <App key={x} /> });