loginUser()
이라는 함수 내에서 두 개의 메서드 호출이 있습니다. 첫 번째는 userInfo를 전달하고 API 요청을 한 다음 메소드를 실행하여 로그인 텍스트 필드를 비 웁니다.ReactJS : "정의되지 않은"속성을 읽을 수 없습니다.
그러나 오류 Cannot read property 'then' of undefined
이 표시됩니다. 무엇이 문제 일 수 있습니까?
코드 :
_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()
})
}
사전에 감사합니다!
'props' 또는'loggingInUser()'와 같이 소리가 나지 않습니다.'props' 나 디버깅을 로그 아웃하고 둘 다 정의되도록 할 수 있습니까? –
'loggingInUser'는 아무것도 반환하지 않을 수도 있습니다 ... – ctrlplusb
loggingInUser 함수는 어떻게 보이나요? – StackOverMySoul