From bdc27a1e46f93c93dd64499153adab3acfb84dfe Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Sun, 18 Apr 2021 23:17:02 -0400 Subject: [PATCH] stop the game --- src/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.js b/src/index.js index 6f0fe35..0a60d3f 100644 --- a/src/index.js +++ b/src/index.js @@ -21,6 +21,9 @@ function Square(props){ handleClick(i) { const squares = this.state.squares.slice(); + if (calculateWinner(squares) || squares[i]) { + return; + } squares[i] = this.state.xIsNext ? 'X' : 'O'; this.setState( {