Remchi/bookworm-react

× TypeError: Cannot read property 'catch' of undefined

Opened this issue · 1 comments

TypeError: Cannot read property 'catch' of undefined

LoginForm.onSubmit
C:/xampp/htdocs/bookworm-app/src/component/Forms/LoginForm.js:27

this.setState({ errors });
if (Object.keys(errors).length === 0) {
this.setState({ loading: true });
this.props
.submit(this.state.data)
.catch(err =>this.setState({ errors: err.response.data.errors, loading: false }));
}

image
From the actual video, played around with the curly braces and fixed it, hope it helps.