isDirty not changing when using defaultValues inside useForm #11567
-
Hello, I have tried to follow the examples and not sure what the issue is but I am using defaultValues inside useForm and isDirty does not change when using defaultValues. Please could someone assist if possible, thanks.
|
Beta Was this translation helpful? Give feedback.
Answered by
sujinleeme
Feb 29, 2024
Replies: 1 comment 5 replies
-
@keanan The codesandbox link is broken or it seems it's not on public. Shall you update the url again? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Only providing
defaultValue
won't changeisDirty
because a comparison between defaultValue and current formValues will be made.To update the formValues at first, you must use
setValue
orreset
.Here is the codesandbox.