How to use custom Input with Formik in React? : <p>I'm trying to use <a href="https://material-ui-pickers.firebaseapp.com/" rel="noreferrer">DatePicker</a> within <a href="https://github.com/jaredpalmer/formik/" rel="noreferrer">Formik</a>. But when I click DatePicker's date its form value is not changed. Instead, I got this error: </p>

<blockquote>
  <p>Uncaught TypeError: e.persist is not a function
  at Formik._this.handleChange (formik.es6.js:5960)</p>
</blockquote>

<p>I shortify code, the code is below</p>

<pre><code>const SomeComponent = () =&gt; (
    &lt;Formik
        render={({
            values,
            handleSubmit,
            handleChange,
            setFieldValue
        }) =&gt; {
            return (
                &lt;div&gt;
                    &lt;form onSubmit={handleSubmit}&gt;
                        &lt;DatePicker
                            name={'joinedAt'}
                            value={values['joinedAt']}
                            onChange={handleChange}
                        /&gt;
                    &lt;/form&gt;
                &lt;/div&gt;
            )
        }}
    /&gt;
)
</code></pre>

<p>I googled few documents, <a href="https://github.com/jaredpalmer/formik/issues/187" rel="noreferrer">https://github.com/jaredpalmer/formik/issues/187</a> and <a href="https://github.com/jaredpalmer/formik/issues/86" rel="noreferrer">https://github.com/jaredpalmer/formik/issues/86</a></p>

<p>So I tried like below, but it's not working. </p>

<pre><code> ...setFieldValue

 &lt;DatePicker
   name={'joinedAt'}
   value={values['joinedAt']}
   onChange={setFieldValue}
 /&gt;
</code></pre>
