-
I'm not clear on how to use changedKeys? I have a fairly basic form but in some cases, I want to know which keys in the model were changed and conditionally do different things. None of my fields are custom components, so it doesn't seem like using the hooks is an option. Might be thinking of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @chiester. What do you mean by using
I guess that you may want to use |
Beta Was this translation helpful? Give feedback.
Hi @chiester. What do you mean by using
changed
instead ofchangedKeys
?changed
is a context property, telling whether or not any of the fields have changed (docs).changedKeys
is a helper (docs), used internally to calculatechangedMap
(docs).I guess that you may want to use
changedMap
instead. It's how uniforms calculate thechanged
property of every field (useField
call). A field is changed if!!get(changedMap, name)
(get
is a Lodash function).