Skip to content

Commit

Permalink
fix(codetabs): fix key warning
Browse files Browse the repository at this point in the history
- closes facebook#1255
  • Loading branch information
alexkrolick committed Mar 17, 2019
1 parent 93e2b7d commit 45abd1d
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions v1/lib/core/CodeTabsMarkdownBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,34 @@ class MarkdownBlock extends React.Component {
return (
<div className="tabs">
<div className="nav-tabs">
{tabs.map((t, i) => (
<div
className={`nav-link${i === 0 ? ' active' : ''}`}
id={`${t.id}-tab`}
data-group={`group_${t.groupId}`}
data-tab={`tabpanel_${t.id}`}>
{t.label}
</div>
))}
{tabs.map((t, i) => {
const id = `tab-group-${groupId}-tab-${t.id}`;
return (
<div
id={id}
key={id}
className={`nav-link${i === 0 ? ' active' : ''}`}
data-group={`group_${t.groupId}`}
data-tab={`tabpanel_${t.id}`}>
{t.label}
</div>
);
})}
</div>
<div className="tab-content">
{tabs.map((t, i) => (
<div
className={`tab-pane${i === 0 ? ' active' : ''}`}
data-group={`group_${t.groupId}`}
tabIndex="-1"
id={`tabpanel_${t.id}`}>
{t.panelContent}
</div>
))}
{tabs.map((t, i) => {
const id = `tab-group-${groupId}-content-${t.id}`;
return (
<div
id={id}
key={id}
className={`tab-pane${i === 0 ? ' active' : ''}`}
data-group={`group_${t.groupId}`}
tabIndex="-1">
{t.panelContent}
</div>
);
})}
</div>
</div>
);
Expand Down

0 comments on commit 45abd1d

Please sign in to comment.