There was a problem with event.preventDefault () in asynchronous code. It does not work, I do not know why.

handleSubmit(event) { event.persist(); auth({ login: this.state.loginInput, password: this.state.passwordInput }) .then(({ canLogin, user }) => { this.props.onLogin(AuthEnum.LOGIN); this.props.user(user); }) .catch(({ canLogin }) => { event.preventDefault(); this.props.onLogin(AuthEnum.CANT_LOGIN); }); 

}

    0