Skip to content

Commit e0ba419

Browse files
BrianMitchLtannerlinsley
authored andcommitted
Add getInputProps to Field instance docs (#346)
1 parent d0d18ef commit e0ba419

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/api.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
- [`useForm`](#useform)
44
- [`useField`](#usefield)
5-
- [`splitFormProps](#splitformprops)
5+
- [`splitFormProps`](#splitformprops)
66
- [`useFormContext`](#useformcontext)
77

88
## `useForm`
@@ -197,6 +197,12 @@ An `object` with the following components, properties and methods:
197197
- `runValidation() => void`
198198
- Use this function to manually run this field's validation.
199199
- This function does not run validation for fields.
200+
- `getInputProps(props: Object {}) => enhanced props Object`
201+
- `onChange: ChangeEventHandler`
202+
- `onBlur: FormEventHandler`
203+
- `...rest` - any other props that will be spread into the enhanced props
204+
- Use this function to set props on input elements. If set, `onChange` and `onBlur` will be wrapped to update the field `value`.
205+
- The enhanced props will always contain `value`, `onChange`, and `onBlur`. Any of the rest that are passed in will also be returned.
200206

201207
#### Field-Specific Methods
202208

0 commit comments

Comments
 (0)