I'm working with a React.js frontend, and when I try to login or signup I get the below error when clicking the login
or Sign up
buttons.
Uncaught TypeError: _this.props.onSubmit is not a function
The stacktrace is pointing to the following file,
/src/containers/Login/index.js
// @flow
import React, { Component } from 'react';
import { Field, reduxForm } from 'redux-form';
import { Link } from 'react-router-dom';
import { css, StyleSheet } from 'aphrodite';
import Input from '../../components/Input';
const styles = StyleSheet.create({ card: { maxWidth: '500px', padding: '3rem 4rem', margin: '2rem auto', },
});
type Props = { onSubmit: () => void, handleSubmit: () => void, submitting: boolean,
}
class LoginForm extends Component { props: Props handleSubmit = (data) => this.props.onSubmit(data); // handleSubmit: (data) => this.props.onSubmit(data); render() { const { handleSubmit, submitting } = this.props; return (
specifically the below line,
handleSubmit = (data) => this.props.onSubmit(data);
Again, any and all help is greatly appreciated.