Repository navigation
Replies: 1 comment
|
Unlike React Hook Form's Calling
This is why passing updated server data to However, you can achieve the exact Solution: Reusable
|
|
Unlike React Hook Form's Calling
This is why passing updated server data to However, you can achieve the exact Solution: Reusable
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Similar to the async initialisation of the form, I'd like to allow iterative changes to the initial state from the server. The idea is that the user has a form which they can drag and drop different entities into. When these entities are added, they will fetch the default values from the server for all entities. But if any entity has already been made dirty then those should be left alone.
This probably isn't too bad for a small form to do a manual isDirty lookup per attribute and make choices based on that. But for a large nested form, this becomes tedious to match up the values from the new & old data in a recursive way.
RHF supports keepDirtyValues for this use case which is very helpful!
All reactions