this are my initial state:
this.state = {
requiredError: false,
addressSelectError: false,
recipientError: false,
open: false,
};
and this is where my problem is:
processCheckout () {
this.setState({
requiredError: true,
addressSelectError: true,
recipientError: true,
}, () => {
console.log('required error', requiredError);
console.log('address error', addressSelectError);
console.log('recipient error', recipientError);
})
}
I have set them all to true but the console still logs false:
I have used the callback but it still does not change. any help?
I am calling the processCheckout() function on onClick() of a button.
EDIT: I have tried console logging in render, and all of them are true
