Skip to content

Commit baa4e47

Browse files
committed
Merge pull request #1 from matthewsimo/master
Suppress Non-unique Key warning from React
2 parents 8ee1026 + 79e9412 commit baa4e47

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+

examples/leaderboard/Leaderboard.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,26 @@ var Leaderboard = React.createClass({
6262
return <span/>;
6363
}
6464
var children = [
65-
<div className="leaderboard">
65+
<div className="leaderboard" key="leaderboard">
6666
{ this.state.players.map(this.renderPlayer) }
6767
</div>
6868
];
6969

7070
if (this.state.selectedName) {
7171
children.push(
72-
<div className="details">
72+
<div className="details" key="details">
7373
<div className="name">{this.state.selectedName}</div>
7474
<input
7575
type="button"
7676
value="Give 5 points"
7777
onClick={this.addFivePoints}
78-
onClick={this.addFivePoints}
7978
/>
8079
</div>
8180
);
8281

8382
} else {
8483
children.push(
85-
<div className="none">Click a player to select</div>
84+
<div className="none" key="notice">Click a player to select</div>
8685
);
8786
}
8887

0 commit comments

Comments
 (0)