How to force form isDirty to reset when new data is available #60
-
Hi, I have a single route that is a simple instance update form. The form submits to itself and the action function then saves the changes to an API. It then returns the latest copy of the instance. I'm using instance.updated from the API as a key into the form as this changes every time the instance is updated in the backend. What is the best way to tell remix form that is should reload the default values so that the isDirty field goes back to false and hence the buttons go back to being disabled?
Console output:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Just needed to reset the form state and pass in the new instance for resetting the default values:
|
Beta Was this translation helpful? Give feedback.
Just needed to reset the form state and pass in the new instance for resetting the default values: