text: import React, { Fragment } from 'react';
  import { connect } from 'react-redux';
  import { Link } from 'react-router-dom';
  import { signup } from '../actions/session';
  
  const mapStateToProps = ({ errors }) => ({
      errors
  });
  
  const mapDispatchToProps = dispatch => ({
      signup: user => dispatch(signup(user))
  });
  
  const Signup = ({ errors, signup }) => {
      const handleSubmit = e => {
          e.preventDefault();
          const user = {
              username: e.target[0].value,
              email: e.target[1].value,
              password: e.target[2].value
          };
          signup(user);
      };
  
      return (
          <Fragment>
              <h1>Signup</h1>
              <p>{errors}</p>
              <form onSubmit={handleSubmit}>
                  <label>
                      Username:
                      <input type="text" name="username"/>
                  </label>
                  <label>
                      Email:
                      <input type="email" name="email"/>
                  </label>
                  <label>
                      Password:
                      <input type="password" name="password"/>
                  </label>
                  <input type="submit" value="Submit"/>
              </form>
              <Link to="/login">Login</Link>
          </Fragment>
      );
  };
  
  export default connect(mapStateToProps, mapDispatchToProps)(Signup);