Skip to content

Commit

Permalink
Merge pull request #663 from Financial-Times/fix-same-key-attr-issue-…
Browse files Browse the repository at this point in the history
…xdash-v6-patch

HIVE-449.Fixed same-children issue with react components
  • Loading branch information
ststdimov authored Apr 7, 2022
2 parents 4d7eedf + 1bc0ec2 commit 0635a83
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/x-teaser-timeline/src/TeaserTimeline.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const TeaserTimeline = (props) => {
<section key={group.date} className="x-teaser-timeline__item-group">
<h2 className="x-teaser-timeline__heading">{group.title}</h2>
<ul className="x-teaser-timeline__items">
{group.items.map((item) => {
{group.items.map((item, index) => {
if (item.id) {
return (
<li key={item.id} className="x-teaser-timeline__item">
Expand All @@ -69,10 +69,10 @@ const TeaserTimeline = (props) => {
</li>
)
} else if (typeof item === 'string') {
return <li key="custom-slot" dangerouslySetInnerHTML={{ __html: item }} />
return <li key={`custom-slot-${index}`} dangerouslySetInnerHTML={{ __html: item }} />
}

return <li key="custom-slot">{item}</li>
return <li key={`custom-slot-${index}`}>{item}</li>
})}
</ul>
</section>
Expand Down

0 comments on commit 0635a83

Please sign in to comment.