title: FormDataConsumer used with ReferenceArrayInput is not working in react-admin
body: <p>I want to use FormDataConsumer to be able to get an array depending on another array:</p>
  
  <pre><code>                &lt;ReferenceInput label="Tipus" source="type" reference="categories" validate={ required() } &gt;
                      &lt;AutocompleteInput optionText="name" /&gt;
                  &lt;/ReferenceInput&gt;
                  &lt;FormDataConsumer&gt;
                      {({formData, ...rest}) =&gt; {
                          console.log(formData)
                          &lt;ReferenceArrayInput source={formData.type} reference="categories" {...rest}&gt;
                              &lt;SelectArrayInput optionText="subcategories.name" /&gt;
                          &lt;/ReferenceArrayInput&gt;
                      }}
                  &lt;/FormDataConsumer&gt;
  </code></pre>
  
  <p>This gives me a syntax error, which I don't really understand why.</p>
  
  <p><a href="https://i.stack.imgur.com/uTtcl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uTtcl.png" alt="Syntax Error"></a></p>
  
  <p>What do I do wrong? </p>