Skip to content

Commit

Permalink
added unique key fields in Photo and Posts components
Browse files Browse the repository at this point in the history
  • Loading branch information
Skona27 committed Jan 24, 2019
1 parent 8534806 commit c341f43
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "orange-zadanie-testowe",
"version": "0.1.0",
"version": "1.0.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Photos/PhotoList.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PropTypes from "prop-types";

const PhotoList = props => (
props.photos.map(photo => (
<PhotoItem {...photo} fullSize={props.photoClick} />
<PhotoItem key={photo.id} {...photo} fullSize={props.photoClick} />
))
);

Expand Down
2 changes: 1 addition & 1 deletion src/components/User/UserPosts.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const UserPosts = props => (
<div>
<h3 className={marginTop}>Recent Posts:</h3>
<ul className={list}>
{props.posts.map(post => (<li><em>Title: {post.title}</em></li>))}
{props.posts.map(post => (<li key={post.id}><em>Title: {post.title}</em></li>))}
</ul>
</div>
);
Expand Down

0 comments on commit c341f43

Please sign in to comment.