Please help me, I really dont get it when the value of this.state.isX printed console is always true. Why setState not work in this case. Here is my source code?`
class Square extends React.Component {
constructor(props) {
super(props);
this.state = {
value: null,
isX: true
};
}
handle(){
this.setState({value: 'X',isX:!this.state.isX});
console.log(this.state.isX)
}
render() {
return (
<button className="square" onClick={() =>{this.handle()}}>
{this.state.value}
</button>
);
}
}