title: How to update the state for a custom component in React-Admin
body: <p>I have the following scenario: using react-admin infrastructure, for a Resource, I have the following Edit View : </p>
  
  <pre><code>import Editor from "react-simple-code-editor";
  
  export const CodeQuestionEdit = props =&gt; (
    &lt;Edit {...props}&gt;
      &lt;SimpleForm&gt;
        &lt;LongTextInput source="text" /&gt;
        &lt;TextField label="Code Block" /&gt;
        &lt;FormDataConsumer&gt;
          {({ formData }) =&gt; (
            &lt;Editor
              value={formData.codeBlock}
              onValueChange={code =&gt; {
                //Update the current edit form ....
              }}
              highlight={code =&gt;
                highlight(code, languages.cs)
                  .split("\n")
                  .map(
                    line =&gt;
                      `&lt;span class="container_editor_line_number"&gt;${line}&lt;/span&gt;`
                  )
                  .join("\n")
              }
              padding={10}
              className="container__editor"
            /&gt;
          )}
        &lt;/FormDataConsumer&gt;
      &lt;/SimpleForm&gt;
    &lt;/Edit&gt;
  );
  </code></pre>
  
  <p>Editor component is not part of the react-admin, how can I update the state of the Editor with what the user types? and then pass this value back to the higher component, so when I save, I expect to have the last value typed passed in.</p>