field-form icon indicating copy to clipboard operation
field-form copied to clipboard

how to avoid throwing error from the validation of form instance

Open unbyte opened this issue 4 years ago • 0 comments

I know this error is only thrown during development

I have some codes similar to the following

const [form] = useForm()
const {data, isLoading} = fetchSomeData()
useEffect(() => {
  if (isLoading) form.setFieldsValue(...)
}, [isLoading, data])
return isLoading ? 'loading' : <Form form={form}>...</Form>

Everything works well but there is an error Warning: Instance created by useFormis not connected to any Form element. Forget to passform prop?

Is there any way to disable this verification 😀

unbyte avatar Sep 27 '21 07:09 unbyte