bookworm-react
bookworm-react copied to clipboard
× TypeError: Cannot read property 'catch' of undefined
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 })); }
From the actual video, played around with the curly braces and fixed it, hope it helps.