+| _{<br> value: any,<br> error: boolean<br> dirty: boolean,<br> onChange: (any, config?) => void<br> onBlur: (event, config?) => void<br> setValue: (value: any) => void<br> validate: (any, config?) => boolean or Promise<boolean><br> reset: () => void,<br> props: {<br> value: any,<br> onChange: (any, config?) => void<br> onBlur: (event, config?) => void<br> }<br>}_ | Object with field's data and callbacks.<br><br><ul><li>`value` - field's current value</li><li>`error` - is error present flag (`true` if value was validated and didn't pass validation, `false` otherwise)</li><li>`onChange` - callback for change event (changes the value and validates it if previous value wasn't correct)</li><li>`onBlur` - callback for blur event (validates the value)</li><li>`setValue` - function for setting the internal value (does not validate the input, enabling support for async data loading)</li><li>`validate` - function for validating field's value</li><li>`reset` - function for resetting field's data</li><li>`dirty` - indicates whether value of field was changed from initial value</li><li>`props` - set of props that can be spread on standard input elements (same as props in root object, just grouped for better DX)</li></ul><br/>`onChange`, `onBlur` and `validate` functions accept config as last parameter - this will override config from `useValidation` if provided. |
0 commit comments