Skip to content

Commit 7b15d9a

Browse files
committed
ADD: tweet.id as the unique key of mapped tweet item
1 parent 5c1a89a commit 7b15d9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

5-redux-react/src/js/components/Layout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default class Layout extends React.Component {
2727
return <button onClick={this.fetchTweets.bind(this)}>load tweets</button>
2828
}
2929

30-
const mappedTweets = tweets.map(tweet => <li>{tweet.text}</li>)
30+
const mappedTweets = tweets.map(tweet => <li key={tweet.id}>{tweet.text}</li>)
3131

3232
return <div>
3333
<h1>{user.name}</h1>

0 commit comments

Comments
 (0)