-| `isDirty` | <TypeText>boolean</TypeText> | Set to `true` after the user modifies any of the inputs.<ul><li>**Important:** make sure to provide all inputs' `defaultValues` at the `useForm`, so hook form can have a single source of truth to compare whether the form is dirty.<CodeArea withOutCopy rawData={`const {\n formState: { isDirty, dirtyFields },\n setValue\n} = useForm({ defaultValues: { test: "" } })\n\n// isDirty: true ✅\nsetValue('test', 'change')\n\n// isDirty: false because there getValues() === defaultValues ❌\nsetValue('test', '')`}/></li><li>File typed input will need to be managed at the app level due to the ability to cancel file selection and [FileList](https://developer.mozilla.org/en-US/docs/Web/API/FileList) object.</li><li>Do not support custom object, Class or File object.</li></ul> |
0 commit comments