title: Accessing all form values from field validate function in React-Final-Form
body: <p>I am creating wrapped versions of the React-Final-Form field component, essentially creating shareable types of fields to speed development at my company. As a part of that, I wanted to create a group of checkboxes, requiring at least one to be checked - but when I attempt to write the validate function, I only seem to have access to the current field.</p>
  
  <ol>
  <li>Based on some other answers and the API documentation, I thought that the validate function received three parameters - validateMyField(value, allValues, fieldState). </li>
  </ol>
  
  <p>When I passed my function to a given field, I get the following:</p>
  
  <pre class="lang-js prettyprint-override"><code>const mustPickAtLeastOne = (value, allValues, fieldState) =&gt; {
    console.log(value) //output: false
    console.log(allValues) //output: undefined
    console.log(fieldState) //output: undefined
  }
  </code></pre>
  
  <ol start="2">
  <li>I was able to get the validation functional by simply adding a marker class to my checkbox fields, and then using a validation function like this:</li>
  </ol>
  
  <pre class="lang-js prettyprint-override"><code>const mustPickAtLeastOne = () =&gt; {
    const numberChecked = document.querySelectorAll("." + markerclass + " input[type=\"checkbox\"]:checked").length;
    return (numberChecked === 0 ? atLeastOneRequiredMsg : undefined);
  }
  </code></pre>
  
  <p>This option is functional from a browser perspective, but smells pretty bad (both because I am attempting to interact with the underlying DOM nodes directly, and because I then can't test this via Jest/Enzyme - so I am missing unit test coverage to know if I break this in the future).</p>
  
  <p>I am using React-Final-Form 6.3.0/Final-Form 4.16.1 - is there something wrong elsewhere, or why can't I get allValues in my validate function? Or is there an entirely better way to implement my "require at least one of these" validation?</p>