What is the best way to programmatically change a field value? #728
-
I have some use cases when I want to get the value of the field and others when I want to programmatic change its value. I tried using useStore, useField, getFieldValue, and setFieldValue but all this seems redundant and not straightforward. Sometimes I have weird behaviors, and sometimes I need to put work around props (like explicit put touch: true). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It's super redundant right now and we need clearer guidance in our docs and beyond. Use |
Beta Was this translation helpful? Give feedback.
It's super redundant right now and we need clearer guidance in our docs and beyond.
Use
setFieldValue
with{touch: true}
. In the future we'll remove thetouch
API and maybe even markgetFieldValue
as@deprecated
to stop folks outside of our internal code from using it.