title: React Formik not handling errors properly
body: <p>I'm using the basic Formik template to work on a Login Form.</p>
  
  <pre><code>onSubmit={(
                      values,
                      { setSubmitting, setErrors /* setValues and other goodies */ }
                    ) =&gt; {
                        props.logMeIn(values);
                      // LoginToSystem(values).then( 
                      //   user =&gt; {
                      //     setSubmitting(false); 
  
                      //     // do whatevs...
                      //     // props.updateUser(user)
                      //   },
                      //   errors =&gt; {
                      //     setSubmitting(false);
                      //     // Maybe transform your API's errors into the same shape as Formik's
                      //     //setErrors(transformMyApiErrors(errors));
                      //     console.log(errors);
                      //   }
                      // );
                  }}
  </code></pre>
  
  <p>This problem is within the <code>onSubmit</code> section; The demo code is commented out but it uses a <code>LoginToSystem</code> function that seems to be a promise. I can not figure out 'what' this function is supposed to me. My function that handles this would be <code>props.logMeIn()</code> - Which also does not work <em>as intended</em></p>
  
  <p>If the login is successful, it will currently work as expected, and everything is fine. However, if the login fails (404, 401, whatever) the form will remain there, and the <code>setSubmitting</code> log stays there so Submit is grayed out but nothing is done.</p>
  
  <p>If I try to replace <code>LoginToSystem</code> with my function, I get an error on the <code>.then</code> that I can't perform <code>.then</code> on <code>undefined</code>.</p>
  
  <p>I'm wondering if perhaps this is because my function is not set up like a Promise?</p>
  
  <pre><code>  loginClickHandler = (user) =&gt; {
      let userObj = {
        email: user.email,
        password: user.password
      }
      axios.post('api/v1/auth/sign_in', userObj)
          .then((res) =&gt; {
            console.log(res.headers);
            let loggedInUser = {
             'access_token': res.headers['access-token'],
             'client': res.headers['client'],
             'uid':res.headers['uid'],
             'signedIn': true
            };
            this.setState({
              user: loggedInUser
            })     
            this.props.retrieve(user.email);
          })
          .catch((err) =&gt; {
              console.log(err);
              return err
          })
  
    };
  </code></pre>
  
  <p>My function does properly catch (Thanks to axios) on the .then/.catch, but perhaps I am supposed to modify those to provide a callback so that <code>onSubmit</code> can properly fire?</p>