Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upDisallow missing `key` prop in JSX elements that likely require a `key` prop (react/jsx-key) #1369
Comments
feross
added
enhancement
ecosystem impact
accepted
labels
Aug 15, 2019
feross
added this to the standard 14 milestone
Aug 15, 2019
feross
changed the title
Disallow missing `key` prop (react/jsx-key)
Disallow missing `key` prop in JSX elements that likely require a `key` prop (react/jsx-key)
Aug 15, 2019
This comment has been minimized.
This comment has been minimized.
|
Shipping in |
feross
closed this
in
13e4bee
Aug 15, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
feross commentedAug 15, 2019
https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
This rule caught a ton of instances where I forgot
keyin bitmidi.com, where I use Preact and the development tools don't seem to warn about this.Warn if an element that likely requires a
keyprop--namely, one present in anarray literal or an arrow function expression.
Rule Details
The following patterns are considered warnings:
In the last example the key is being spread, which is currently possible, but discouraged in favor of the statically provided key.
The following patterns are not considered warnings: