title: How to create a simple formik field for entering date and time?
body: <p>I am trying to create a very simple formik field for entering date and time. The requirements are:</p>
  <ol>
  <li>The field's value should be a JavaScript <code>Date</code>.</li>
  <li>The field should allow entering free-form text in an input field and convert it to a <code>Date</code> on blur events.</li>
  <li>The field should display an error if the entered string cannot be converted to a valid date.</li>
  <li>If the form is reset, the field should show the initial value of the date.</li>
  </ol>
  <p>While I was able to satisfy requirements 1 &amp; 2 quite easily, I am having trouble with requirements 3 &amp; 4. I think part of the problem is that I am storing the raw text of the input field in internal state. However, I can't think of another way. Is there a better pattern?</p>
  <p>Here's my <a href="https://codesandbox.io/s/formik-datetime-field-f3cn4?file=/src/DateTimeField.tsx" rel="nofollow noreferrer">CodeSandbox</a>. Please see the sections marked with &quot;Issue 1&quot; &amp; &quot;Issue 2&quot;</p>