diff --git a/src/logic.js b/src/logic.js index ee9637f..6e6f181 100644 --- a/src/logic.js +++ b/src/logic.js @@ -102,8 +102,8 @@ const startingBoard = () => { } const textFromBoard = ({ state }) => { - const turn = (this.state.blackIsNext? 'B' : 'W'); - return turn + this.state.squares.map(square => { + const turn = state?.blackIsNext ? 'B' : 'W'; + return turn + state?.squares.map(square => { if (!square) { return '_'; }