Skip to content

Commit

Permalink
Specify a unique "key" prop for each child in an array
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Dec 15, 2017
1 parent 4e49839 commit a5fccdf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/Default/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ export default class extends PureComponent {
return (
<Breadcrumbs>
{list.map((item, index) => (
<Breadcrumbs.Item active={index === list.length - 1}>{item}</Breadcrumbs.Item>
<Breadcrumbs.Item
active={index === list.length - 1}
key={`${selected}_${index}`}
>
{item}
</Breadcrumbs.Item>
))}
</Breadcrumbs>
);
Expand Down

0 comments on commit a5fccdf

Please sign in to comment.