Answer the question
In order to leave comments, you need to log in
How to write a comparison operator correctly?
// so the state changes, but it is necessary that it does not change, but I'm stupid
constructor(props) {
super();
this.state = {
gameBoard: arr,
turn: 'X',
player: 0,
connect: 'disabled',
}
}
updateBoard(loc) {
if(this.state.player = 1){ // так state меняется а нужно чтобы не менялось но я туплю
this.setState({ turn: '0' });
} else if (this.state.player = 2){
this.setState({ turn: 'X' });
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question