Skip to content

Commit

Permalink
Get rid of anti-pattern and use data.id for key
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysiek1507 authored Mar 27, 2017
1 parent 9253200 commit 9a6c557
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions conventions/07.inline-list-iteration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

return (
<div>
{this.props.list.map(function (data, i) {
return (<Component data={data} key={i}/>)
{this.props.list.map(function (data) {
return (<Component data={data} key={data.id}/>)
})}
</div>
);
);

0 comments on commit 9a6c557

Please sign in to comment.