issue: fields that use Controller or useController with its own defaultValue don't reset when resetField() is called after unmounting #10572
Unanswered
andre-kingsmen
asked this question in
Q&A
Replies: 2 comments 1 reply
-
please provide defaultValues: |
Beta Was this translation helpful? Give feedback.
1 reply
-
Is it correct that it hasn't been resolved? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Version Number
7.45.0
Codesandbox/Expo snack
https://codesandbox.io/p/sandbox/dreamy-taussig-zhjn4k
Steps to reproduce
resetField("firstName")
)Expected behaviour
Results:
useForm()
has the correct values, check the logs (which showswatch("firstName")
, correctly showing undefined), although it should technically be the value of the defaultValue of the - which is another issue i thinkNotes:
useForm({ defaultValue: "" })
, it does work properlysetValue("firstName", "somethin")
does work, click on "set value" to seeWhat browsers are you seeing the problem on?
Chrome
Relevant log output
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions