title: Formik - TypeError: Cannot read property 'type' of undefined?
body: <p>I've pretty much just <a href="https://codesandbox.io/s/formik-checkbox-example-96miz?from-embed" rel="nofollow noreferrer">copy pasted this code from here</a> :</p>
  
  <pre><code>function Checkbox(props) {
    return (
      &lt;Field name={props.name}&gt;
        {({ field, form }) =&gt; (
          &lt;label&gt;
            &lt;input
              {...field}
              type="checkbox"
              checked={field.value.includes(props.value)}
              onChange={() =&gt; {
                const set = new Set(field.value);
                if (set.has(props.value)) {
                  set.delete(props.value);
                } else {
                  set.add(props.value);
                }
                field.onChange(field.name)(Array.from(set)); //the problem seems to lie here somewhere!
                form.setFieldTouched(field.name, true);
              }}
            /&gt;
            {props.value}
          &lt;/label&gt;
        )}
      &lt;/Field&gt;
    );
  }
  
  function App() {
    return (
      &lt;Formik
        initialValues={{ roles: [] }}
        onSubmit={values =&gt; alert(JSON.stringify(values, null, 2))}
      &gt;
        {formik =&gt; (
          &lt;div&gt;
            Clicking checks affects `VALUES` and `ERRORS` but never `TOUCHED`...
            &lt;div&gt;
              &lt;Checkbox name="roles" value="admin" /&gt;
              &lt;Checkbox name="roles" value="customer" /&gt;
            &lt;/div&gt;
            &lt;br /&gt;
            VALUES:
            &lt;pre&gt;{JSON.stringify(formik.values, null, 2)}&lt;/pre&gt;
            ERRORS:
            &lt;pre&gt;{JSON.stringify(formik.errors, null, 2)}&lt;/pre&gt;
            TOUCHED:
            &lt;pre&gt;{JSON.stringify(formik.touched, null, 2)}&lt;/pre&gt;
          &lt;/div&gt;
        )}
      &lt;/Formik&gt;
    );
  }
  </code></pre>
  
  <p>The Sandbox seems to be working, but whenever I check a checkbox locally, I get <code>TypeError: Cannot read property 'type' of undefined</code></p>
  
  <pre><code>TypeError: Cannot read property 'type' of undefined
  (anonymous function)
  node_modules/formik/dist/formik.esm.js:659
    656 |   dispatch({
    657 |     type: 'SET_ERRORS',
    658 |     payload: errors
  &gt; 659 |   });
    660 | }, []);
    661 | var setValues = useEventCallback(function (values) {
    662 |   dispatch({
  </code></pre>
  
  <p>Not sure what I've done wrong here?</p>