stop the game
This commit is contained in:
parent
d3f8ad21a1
commit
bdc27a1e46
@ -21,6 +21,9 @@ function Square(props){
|
|||||||
|
|
||||||
handleClick(i) {
|
handleClick(i) {
|
||||||
const squares = this.state.squares.slice();
|
const squares = this.state.squares.slice();
|
||||||
|
if (calculateWinner(squares) || squares[i]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
squares[i] = this.state.xIsNext ? 'X' : 'O';
|
squares[i] = this.state.xIsNext ? 'X' : 'O';
|
||||||
this.setState(
|
this.setState(
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user