I have simple check, which I must do when user clicking the button:
<button
onClick={() => {
this.props.validatingActions.validate(this.props.Email.Value);
this.props.submittingActions.submitValidation(this.props.Email.IsValid);
}}>Submit</button>
At first, email in Redux store validates, then, some actions do, when email is valid or not.
The problem is, that this.props don't update after executing this.props.validatingActionsvalidate
, they're only updates after leaving anonymous onClick
function, therefore this.props.Email.IsValid
has old value.
How can I properly update props in such situations?