Open ft20082 opened 5 months ago
如果 ModalForm 封装为 组件时,在组件里使用
` // 这步不会报错 const [modalForm] = Form.useForm();
// 设置初始化字段值会提醒 modalForm.setFieldsValue(data) Instance created by useForm is not connected to any Form element. Forget to pass form prop? `
useForm
form
会提醒上面的报错,但是值也会初始化。
如果 ModalForm 封装为 组件时,在组件里使用
` // 这步不会报错 const [modalForm] = Form.useForm();
// 设置初始化字段值会提醒 modalForm.setFieldsValue(data)
Instance created by
useForm
is not connected to any Form element. Forget to passform
prop? `会提醒上面的报错,但是值也会初始化。