From 4ca8040bd6178c63f170495d17cbccb302ce256f Mon Sep 17 00:00:00 2001 From: Alex Krolick Date: Sun, 17 Mar 2019 15:40:40 -0700 Subject: [PATCH] fix(codetabs): fix key warning - closes #1255 --- v1/lib/core/CodeTabsMarkdownBlock.js | 44 ++++++++++++++++------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/v1/lib/core/CodeTabsMarkdownBlock.js b/v1/lib/core/CodeTabsMarkdownBlock.js index 3a19a4a8bd990..c11998436b325 100644 --- a/v1/lib/core/CodeTabsMarkdownBlock.js +++ b/v1/lib/core/CodeTabsMarkdownBlock.js @@ -28,26 +28,34 @@ class MarkdownBlock extends React.Component { return (
- {tabs.map((t, i) => ( -
- {t.label} -
- ))} + {tabs.map((t, i) => { + const id = `tab-group-${groupId}-tab-${t.id}-${i}`; + return ( +
+ {t.label} +
+ ); + })}
- {tabs.map((t, i) => ( -
- {t.panelContent} -
- ))} + {tabs.map((t, i) => { + const id = `tab-group-${groupId}-content-${t.id}-${i}`; + return ( +
+ {t.panelContent} +
+ ); + })}
);