I have two method calls within a function called loginUser()
. The first passes in userInfo and makes an API request, and then would like to execute the method to empty out the login text fields.
But I am getting the error Cannot read property 'then' of undefined
. What may be the issue?
Code:
_loginUser() {
this.props.loggingInUser(this.props.userInfo) //Would like to finish this first before moving onto calling this.props.emptyLoginTextFields()
.then(() => { //Here is where the error is occurring
this.props.emptyLoginTextFields()
})
}
Thank you in advance!