You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`name`| <TypeText>[`FieldPath`](/ts#FieldPath"FieldPath type")</TypeText> | ✓ | Unique name of your input. |
20
-
| control | <TypeText>[`Control`](/ts#Control"Control type")</TypeText> ||[`control`](/docs/useform/control) object is from invoking `useForm`. Optional when using `FormProvider`. |
21
-
|`render`| <TypeText>Function</TypeText> || This is a [render prop](https://reactjs.org/docs/render-props.html). A function that returns a React element and provides the ability to attach events and value into the component. This simplifies integrating with external controlled components with non-standard prop names. Provides `onChange`, `onBlur`, `name`, `ref` and `value` to the child component, and also a `fieldState` object which contains specific input state. |
22
-
|`defaultValue`| <TypeText>unknown</TypeText> ||**Important:** Can not apply `undefined` to `defaultValue` or `defaultValues` at `useForm`. <ul><li>You need to either set `defaultValue` at the field-level or `useForm`'s `defaultValues`. `undefined` is not a valid value.</li><li>If your form will invoke `reset` with default values, you will need to provide `useForm` with `defaultValues`.</li><li>Calling `onChange` with `undefined` is not valid. You should use `null` or the empty string as your default/cleared value instead.</li></ul>|
23
-
|`rules`| <TypeText>Object</TypeText> || Validation rules in the same format for [`register` options](/docs/useform/register#options), which includes:<br/><br/>required, min, max, minLength, maxLength, pattern, validate |
24
-
|`shouldUnregister`| <TypeText>boolean = false`</TypeText> ||Input will be unregistered after unmount and defaultValues will be removed as well.<br/><br/>**Note:** this prop should be avoided when using with `useFieldArray` as `unregister` function gets called after input unmount/remount and reorder.|
25
-
|`disabled`| <TypeText>boolean = false`</TypeText> ||`disabled` prop will be returned from `field` prop. Controlled input will be disabled and its value will be omitted from the submission data. |
|`name`| <TypeText>[`FieldPath`](/ts#FieldPath"FieldPath type")</TypeText> | ✓ | Unique name of your input. |
20
+
| control | <TypeText>[`Control`](/ts#Control"Control type")</TypeText> ||[`control`](/docs/useform/control) object is from invoking `useForm`. Optional when using `FormProvider`. |
21
+
|`render`| <TypeText>Function</TypeText> || This is a [render prop](https://reactjs.org/docs/render-props.html). A function that returns a React element and provides the ability to attach events and value into the component. This simplifies integrating with external controlled components with non-standard prop names. Provides `onChange`, `onBlur`, `name`, `ref` and `value` to the child component, and also a `fieldState` object which contains specific input state. |
22
+
|`rules`| <TypeText>Object</TypeText> ||Validation rules in the same format for [`register` options](/docs/useform/register#options), which includes:<br/><br/>required, min, max, minLength, maxLength, pattern, validate |
23
+
|`shouldUnregister`| <TypeText>boolean = false`</TypeText> ||Input will be unregistered after unmount and defaultValues will be removed as well.<br/><br/>**Note:** this prop should be avoided when using with `useFieldArray` as `unregister` function gets called after input unmount/remount and reorder.|
24
+
|`disabled`| <TypeText>boolean = false`</TypeText> ||`disabled` prop will be returned from `field` prop. Controlled input will be disabled and its value will be omitted from the submission data. |
25
+
|`defaultValue`| <TypeText>unknown</TypeText> ||**Important:** Can not apply `undefined` to `defaultValue` or `defaultValues` at `useForm`. <ul><li>You need to either set `defaultValue` at the field-level or `useForm`'s `defaultValues`. If you used <code>defaultValues</code> at <code>useForm</code>, skip using this prop.</li><li>If your form will invoke `reset` with default values, you will need to provide `useForm` with `defaultValues`.</li><li>Calling `onChange` with `undefined` is not valid. You should use `null` or the empty string as your default/cleared value instead.</li></ul>|
0 commit comments