From dab37155e4fb5b47132bcf39d8c3857b008b16e4 Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Wed, 7 Dec 2016 23:24:27 +0000 Subject: [PATCH] Add keys to iterators --- app/components/chess-board.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/components/chess-board.js b/app/components/chess-board.js index c4ab223..4b0427c 100644 --- a/app/components/chess-board.js +++ b/app/components/chess-board.js @@ -10,10 +10,12 @@ class ChessBoard extends React.Component { this.state = defaultState; } - chessBoardRow(row) { + chessBoardRow(row, i) { return ( -
- {row.map((square) => )} +
+ {row.map( + (square, j) => + )}
) } @@ -21,7 +23,7 @@ class ChessBoard extends React.Component { render() { return (
- {this.state.board.map((row) => this.chessBoardRow(row))} + {this.state.board.map((row, i) => this.chessBoardRow(row, i))}
); }