as I wrote in the title, please give me a hint on how to reset isDirty field from formState object.
In my application, I have a 'save' button which is disabled by default. When I change the value of any input the button is set to enabled because isDirty state is changed to true.
After a successful save action, I want to make my save button disabled again (so I need to set isDirty as false again).
After successful form submission, you can reset form to its original state using reset from useForm hook. This will reset formState and isDirty value will be false.
Docs: https://react-hook-form.com/docs/useform/reset
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With