-
Hi, I use Yup to set up a schema. In that schema I have a transformation that I apply as follows:
When watching the value as follows:
I get the pre-transformed value. Is there an option to apply the transformation within useWatch? any other way I can keep the code concise? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can use For example:
|
Beta Was this translation helpful? Give feedback.
@rhwork
useWatch
hook has nothing to do with transformation logic from schema object validation since it's only watching change on input original value.You can use
.pick()
then perform.cast()
to get the transformed value.For example: