title: How can I use initialValue for DatePicker in Form.Item of Ant Design
body: <p>Ant Design says I can't use <code>defaultValue</code> if I wrapped it with <code>Form.Item</code> with <code>name</code>.</p>
  
  <p><a href="https://ant.design/components/form/" rel="noreferrer">https://ant.design/components/form/</a></p>
  
  <pre><code>After wrapped by Form.Item with name property, value(or other property defined by valuePropName) onChange(or other property defined by trigger) props will be added to form controls, the flow of form data will be handled by Form which will cause:
  
  You shouldn't use onChange on each form control to collect data(use onValuesChange of Form), but you can still listen to onChange.
  
  You cannot set value for each form control via value or defaultValue prop, you should set default value with initialValues of Form. Note that initialValues cannot be updated by setState dynamiclly, you should use setFieldsValue in that situation.
  </code></pre>
  
  <p>So I set <code>initialValues</code> to <code>Form</code> component and I got this error when I use Form with DatePicker.</p>
  
  <pre><code>moment.js:93 Uncaught TypeError: date.clone is not a function
      at Object.format (moment.js:93)
      at useValueTexts.js:13
      at Array.map (&lt;anonymous&gt;)
      at useValueTexts.js:12
      at useMemo (useMemo.js:6)
      at useValueTexts (useValueTexts.js:7)
      at InnerPicker (Picker.js:158)
      at renderWithHooks (react-dom.development.js:14803)
      at mountIndeterminateComponent (react-dom.development.js:17482)
      at beginWork (react-dom.development.js:18596)
  </code></pre>
  
  <p>My code is like this.<br />
  <code>worker</code> object has a <code>dateOfBirth</code> which is ISOString.</p>
  
  <pre class="lang-js prettyprint-override"><code>const dateFormat = 'YYYY/MM/DD';
  
  return (
    &lt;Form
      layout="vertical"
      hideRequiredMark
      onFinish={values =&gt; onFinish(values)}
      initialValues={worker}
    &gt;
      &lt;Form.Item
        label="Date Of Birth"
        name="dateOfBirth"
      &gt;
        &lt;DatePicker format={dateFormat} /&gt;
      &lt;/Form.Item&gt;
    &lt;/Form&gt;
  );
  </code></pre>
  
  <p>How can I get and use default value of worker's dateOfBirth?<br />
  Thank you.</p>