From 33c974ffee628903f0dd9f7fa1d675d32ccdbaa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Go=C5=82=C4=85b?= Date: Thu, 2 Nov 2017 21:07:24 +0100 Subject: [PATCH] Update jsx-key.md Fix bugs in rendering an array of elements to prevent from unintentional copying it. --- docs/rules/jsx-key.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/rules/jsx-key.md b/docs/rules/jsx-key.md index d94a7bb9f1..75b5b5c960 100644 --- a/docs/rules/jsx-key.md +++ b/docs/rules/jsx-key.md @@ -10,7 +10,7 @@ The following patterns are considered warnings: ```jsx [, , ]; -data.map(x => x); +data.map(x => {x}); ``` The following patterns are **not** considered warnings: @@ -18,7 +18,7 @@ The following patterns are **not** considered warnings: ```jsx [, , ]; -data.map((x, i) => x); +data.map((x, i) => {x}); ``` ## When not to use