title: Clear a field's value on input clear in react-final-form
body: <p>I'm using a custom component with <code>react-final-form</code>. On input change it sets the value to the <code>address</code> field. But when the input is cleared it doesn't update the value of the field. So I'm trying to do it with form mutators.</p>
  
  <p>I have already added a mutator for clearing the field:</p>
  
  <pre><code>mutators={{
    clear: ([address], state, { changeValue }) =&gt; {
      changeValue(state, "address", () =&gt; undefined);
    }
  }}
  </code></pre>
  
  <p>I tried to add it to my custom onChange function, but it doesn't work.</p>
  
  <pre><code>onChange={event =&gt;
    props.input.onChange !== undefined
      ? props.input.onChange({ value: event })
      : form.mutators.clear
  }
  </code></pre>
  
  <p>Or maybe this can be done without mutators at all? I would really appreciate your help. Here is a <a href="https://codesandbox.io/s/react-final-from-wreact-dadata-u0skz?fontsize=14" rel="nofollow noreferrer">live example</a> (clearing the field works only on the button click as <code>onClick={form.mutators.clear}</code>).</p>