import React from 'react'; import {withRouter} from 'react-router-dom'; class LoginForm extends React.Component { constructor(props) { super(props); this.state = { email: "", password: "" }; this.handleSubmit = this.handleSubmit.bind(this); } handleSubmit(e) { e.preventDefault(); const user = Object.assign({}, this.state); this.props.processForm(user); } update(field) { return (e) => { e.preventDefault(); this.setState({[field]: e.target.value}); }; } renderLogin(){ const errors = this.props.errors; const {formType} = this.props; if(formType === "LOGIN"){ return(