defaultValues and dirty #7654
-
Is there a way to make the I know that you can do that also with Thank you! :) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
What about the |
Beta Was this translation helpful? Give feedback.
-
If you only need the form state to be set to dirty (I'd imaging, you want something like "enable submit button on form useEffect(() => {
setValue("name", "", { shouldDirty: true });
reset(defaultValues, { keepDirty: true });
}, [setValue, reset]); See this CSB I don't think there's gonna be another "proper" way to do what you want, as |
Beta Was this translation helpful? Give feedback.
-
Thanks @Moshyfawn for the help. I think you can use |
Beta Was this translation helpful? Give feedback.
Thanks @Moshyfawn for the help. I think you can use
keepDefaultValues: true
, so thedefaultValues
will be remained and dirty check will be checked against new values and existingdefaultValeus
.