From 4bce72deafdf4784b8d21049a937e0cec03a733f Mon Sep 17 00:00:00 2001 From: Carl Worth <cworth@cworth.org> Date: Fri, 5 Jun 2020 10:15:59 -0700 Subject: [PATCH] Add key properties to GameInfo and PlayerInfo blocks This silences the warning that React gives: Warning: Each child in a list should have a unique "key" prop Which I seem to get every time I add a new list of elements. --- tictactoe/tictactoe.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tictactoe/tictactoe.jsx b/tictactoe/tictactoe.jsx index 498e708..5bb84f1 100644 --- a/tictactoe/tictactoe.jsx +++ b/tictactoe/tictactoe.jsx @@ -247,15 +247,17 @@ class Game extends React.Component { return [ <GameInfo + key="game-info" id={this.state.game_info.id} url={this.state.game_info.url} />, <PlayerInfo + key="player-info" id={this.state.player_info.id} name={this.state.player_info.name} team={this.state.player_info.team} />, - <div className="game"> + <div key="game" className="game"> <div>{status}</div> <div className="game-board"> <Board -- 2.45.2