title: How to dynamically set a required rule to the Form.Item validation
body: <p>I have a list of parameters that may be checked or not. Its correspondent fields are enabled/disabled in dependence of checkbox state. So I want to enable and validate field if parameter is checked, and disable field and turn off validation rule while checkbox is unchecked. 
  But I can't switch <code>required</code> rule to <code>false</code> while toggling checkbox.</p>
  
  <p><a href="https://i.stack.imgur.com/SVE0M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SVE0M.png" alt=""></a></p>
  
  <p>As you see the <code>registrations</code> parameter is unchecked but the field still have a validation.. </p>
  
  <p>Here is how I've done it: </p>
  
  <pre><code>&lt;Row key={index} gutter={8}&gt;
    &lt;Col span={6} offset={4}&gt;
      &lt;Form.Item help=""&gt;
        &lt;Checkbox
          checked={attribute.isActive}
          disabled={isViewMode}
          onChange={this.handleChangeAttributeActive(attribute.eventId)}
          value={attribute.name}
        &gt;
          {attribute.name}
        &lt;/Checkbox&gt;
      &lt;/Form.Item&gt;
    &lt;/Col&gt;
    &lt;Col span={8}&gt;
      &lt;Form.Item help=""&gt;
        {getFieldDecorator(`${attribute.name}`, {
          initialValue: attribute.attributeSendName,
          rules: [{ required: attribute.isActive }],
        })(
          &lt;Input
            disabled={isViewMode || !attribute.isActive}
          /&gt;
        )}
      &lt;/Form.Item&gt;
    &lt;/Col&gt;
  &lt;/Row&gt;
  </code></pre>
  
  <p><code>attributes</code> is an array of parameters that stores in component state.
  Checkbox handler just switch to opposite <code>isActive</code> property</p>
  
  <p>Can you please help? Thank</p>