Skip to content

Commit

Permalink
4th step: Solve dynamic list key error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrcel97 committed Aug 22, 2018
1 parent a491f21 commit fb6953c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class Game extends React.Component {
const moves = this.history.map((step, move) => {
const desc = move ? 'Go to move #' + move : 'Go to game start';
return (
<li>
<li key={move}> {/* React dinamic lists need to have a key to diferenciate each other. If no key is provided this will
* generate a warning message. */}
<button onClick={() => this.jumpTo(move)}>{desc}</button>
</li>
);
Expand Down

0 comments on commit fb6953c

Please sign in to comment.