I am developing a data entry form that involves complex relationships between individual fields and the data service. I may be in a situation where Form.onChange may be helpful, but I'm not sure. The online documentation says "Use onChange only if you cannot achieve the desired behavior through the Field component by FormRenderProps." but doesn't actually given an example. How do I call this method?
Note: This is not about FieldRenderProps.onChange.
Do I have to stick the component in a variable and call the method directly? Is it like this?function FuncyComponent() {
const someData = {id: 123, etc};
const form = <Form initialValues={someData} render={formRenderProps =>
<FormElement>some fields</FormElement>} />;
const handleButtonClick = (event: whatever) => {
form.onChange("id", {value: 9876});
};
return <div>
{form}
<button onClick={handleButtonClick}>Change The ID</button>
</div>;
}