From f12839670019c916a40cdcdf71a505d2ef7db41f Mon Sep 17 00:00:00 2001 From: awthwathje Date: Tue, 3 Apr 2018 13:08:38 +0300 Subject: [PATCH] Added key object spread example Spreaded key is discouraged and currently triggering the rule. Added some clarification to the doc. Resolves yannickcr/eslint-plugin-react#1753. --- docs/rules/jsx-key.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/rules/jsx-key.md b/docs/rules/jsx-key.md index 75b5b5c960..6e7b71ef94 100644 --- a/docs/rules/jsx-key.md +++ b/docs/rules/jsx-key.md @@ -11,14 +11,20 @@ The following patterns are considered warnings: [, , ]; data.map(x => {x}); + + ``` +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: ```jsx [, , ]; data.map((x, i) => {x}); + + ``` ## When not to use