인프런 커뮤니티 질문&답변
this.props.signIn(submittedForm) Error
작성
·
136
0
안녕하세요 강사님!! 강의 정말
잘듣고 있습니다!
코드는 그대로 작성했는데 에러가나서 혹시 해결방안좀 제시해 주 실수 있나 싶어서 글올립니다.
로그인시 에러가 발생합니다.!
submitUser = () => {
// Init.
let isFormValid = true;
let submittedForm = {};
const formCopy = this.state.form;
for (let key in formCopy) {
if (this.state.type === '로그인') {
if (key !== 'confirmPassword') {
isFormValid = isFormValid && formCopy[key].valid;
submittedForm[key] = formCopy[key].value;
}
} else {
isFormValid = isFormValid && formCopy[key].valid;
submittedForm[key] = formCopy[key].value;
}
}
if (isFormValid) {
if (this.state.type === '로그인') {
this.props.signIn(submittedForm).then(()=>{
this.manageAccess();
})
} else {
this.props.signUp(submittedForm).then(()=>{
this.manageAccess();
})
}
} else {
this.setState({
hasErrors: true
})
}
}답변
답변을 기다리고 있는 질문이에요
첫번째 답변을 남겨보세요!





