خرید بک لینک

Vote count: 0

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 (
      

Login to Sling


Create a new account </Link> </form> ); } } const validate = (values) => { const errors = {}; if (!values.email) { errors.email = 'Required'; } if (!values.password) { errors.password = 'Required'; } return errors; }; export default reduxForm({ form: 'login', validate, })(LoginForm);

specifically the below line,

  handleSubmit = (data) => this.props.onSubmit(data);

Again, any and all help is greatly appreciated.

asked 31 secs ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 20 ارديبهشت 1396 ساعت: 5:57

صفحه بندی