Version Number
7.56.4
Codesandbox/Expo snack
https://codesandbox.io/p/sandbox/rhf-fieldarray-reset-bug-kcdg5q
Steps to reproduce
Everything is also explained in the code sandbox.
- Clic "Reset Form" (should do nothing)
- Clic either "Append" or "Delete" ONCE
- Error: isDirty is false and should be true
Expected behaviour
After reseting a form and calling useFieldArray's append or remove methods, the form's isDirty state should be changed to true BUT is still false.
What browsers are you seeing the problem on?
No response
Relevant log output
Notes :
- useFieldArray is provided in a React Context here instead of prop drilling its values. This looks like the reason why this doesn't work.
- To reproduce this bug you MUST have some other components using useFormState (see FormDebug that is subscribed to isDirty, isValid, submitCount and isReady)
Code of Conduct
Version Number
7.56.4
Codesandbox/Expo snack
https://codesandbox.io/p/sandbox/rhf-fieldarray-reset-bug-kcdg5q
Steps to reproduce
Everything is also explained in the code sandbox.
Expected behaviour
After reseting a form and calling useFieldArray's append or remove methods, the form's isDirty state should be changed to true BUT is still false.
What browsers are you seeing the problem on?
No response
Relevant log output
Code of Conduct