title: Antd form.item required conditional
body: <p>I have a form, with a password input, this form its used for Create a user, and for Edit that user, taking initialvalues from a state (internal), the code its like this:</p>
  <pre><code>&lt;Form.Item
      label=&quot;Password&quot;
      name=&quot;password&quot;
      style={{ marginBottom: &quot;14px&quot; }}
      rules={[{
                pattern: new RegExp(/^((?=\S*?[A-Z])(?=\S*?[a-z])(?=\S*?[0-9]).{6,})\S$/),
                message: &quot;uppercase, lowercase and number&quot;},
              {required: true,
              message: &quot;create a password&quot;,},]}
    &gt;
      &lt;Input.Password
        style={{ maxWidth: 300 }}
        autoComplete=&quot;off&quot;
      /&gt;
    &lt;/Form.Item&gt;
  </code></pre>
  <p>I need to disable the required password field when editing the user, that is when initialvalues are taking them out of the state, for example the field first_name: internal.first_name. so I tried this</p>
  <pre><code>required: ({ getFieldValue }) =&gt; getFieldValue(&quot;email&quot;) !== undefined ? true : false
  </code></pre>
  <p>But didn't work, always pass true.
  thanks for the &quot;input&quot;</p>