I am having a hard time with antd\'s form. I have this select field in this form and I want to get the value from it onChange but somehow not getting it to work properly.
<
I realize this is super late, but I think this might be what OP was looking for:
https://github.com/react-component/form/blob/3b9959b57ab30b41d8890ff30c79a7e7c383cad3/examples/server-validate.js#L74-L79
To set fields on a form dynamically, e.g. in a child via a callback, you could use
this.props.form.setFields({
user: {
value: values.user,
errors: [new Error('forbid ha')],
},
});
in a parent defined handleSelect
method you called from the child on a selected value. you can alternatively use setFieldsValue
if you dont want to pass an error field