PUBLIC Questions Tags Users COLLECTIVES Explore Collectives FIND A JOB Jobs Companies TEAMS Stack Overflow for Teams – Collaborate and share knowledge with a private group. setState doesn't update the state immediately
//our state needs some time to mutate, and since console.log(this.state.boardAddModalShow)
executes before the state mutates, you get the previous value as output. So you need
to write the console in the callback to the setState function
this.setState({ name: "myname" }, () => {
//callback
console.log(this.state.name) // myname
});