This.setState() is working for almost all variables in my component, but not all.
When i try to set the state of a state variable the value does not change which is a very strange behavior.
this.setState({ notSaved: size }, () => {
console.log(this.state.notSaved, 'notSaved','size',size);
});
}
This is not a problem with the async behavior of the setSate, as you can see in the image below, because even if I console.log the value inside the callback, still unchanged. So this is not a duplicated question.