Implement dirtyFields #1618
Replies: 2 comments 1 reply
-
it's not really set up to do that, vaidate on client or server and handles the whole form either way. over 100 fields is recommended to break into smaller forms.
but i think you'd want to use the transforms to merge form state on submit, i don't think the API is set up to be iterable like that. You'd essentially be saving a copy and needing to compare the new version. you may be able to hack something with |
Beta Was this translation helpful? Give feedback.
-
There's some things that should be clarified for dirtyFields. Take this const defaultValues = {
foo: '',
bar: 0,
nested: {
foo: '',
bar: 0
},
someArray: [
{ foo: "" },
{ bar: 0 }
]
} Here's some assumptions I'd make for changing some of these fields:
Let me know your thoughts. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Imagine you have a really large form (we're talking over 100 fields). When editing a form, I only change 1 or 2 fields, for example, and when I submit it, I want to send only those changes to the backend, not all the data.
I used this feature with RHF and Yup, and it proved to be really useful for this specific case (although I had to make adjustments like this. What do you think?
Beta Was this translation helpful? Give feedback.
All reactions