We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FormInstance
Does sharing the same FormInstance between multiple <Form /> components considered correct?
<Form />
Example:
function SampleWithError() { const [form] = Form.useForm(); return ( <> <Form form={form}> <Field name="one"></Field> </Form> <Form form={form}> <Field name="two"></Field> </Form> <button onClick={async () => { console.log(await form.validateFields()); }}> Validate </button> </> ) }
Also, some of my observations on form behavior for this particular case:
In the following code-sandbox form.validateFields() merges fields values from both forms. Form seems to work correctly.
form.validateFields()
However, callbacks: onValuesChange, onFieldsChange, onFinish and onFinishFailed are only triggered for the last form. (they get overwritten here)
onValuesChange
onFieldsChange
onFinish
onFinishFailed
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Does sharing the same
FormInstance
between multiple<Form />
components considered correct?Example:
Also, some of my observations on form behavior for this particular case:
In the following code-sandbox
form.validateFields()
merges fields values from both forms. Form seems to work correctly.However, callbacks:
onValuesChange
,onFieldsChange
,onFinish
andonFinishFailed
are only triggered for the last form. (they get overwritten here)The text was updated successfully, but these errors were encountered: