You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using zod as my validation lib, and followed the guidelines on how to build multi-step forms, my problem is that in the final step, the values inside the handleSubmit callback, are only of the last validation schema i.e last parsed schema from ZOD.
Is that the expected behavior when using ZOD?
Printed the values from useForm();
As you see it has all the other fields besides discount object.
But inside the handleSubmit function, it always gives you only the current step parsed schema:
I can just use the values from the useForm(), but I'm curious if this is a bug or intended behaviour...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using zod as my validation lib, and followed the guidelines on how to build multi-step forms, my problem is that in the final step, the values inside the
handleSubmit
callback, are only of the last validation schema i.e last parsed schema from ZOD.Is that the expected behavior when using ZOD?
Printed the
values
fromuseForm()
;As you see it has all the other fields besides
discount
object.But inside the handleSubmit function, it always gives you only the current step parsed schema:
I can just use the
values
from theuseForm()
, but I'm curious if this is a bug or intended behaviour...Beta Was this translation helpful? Give feedback.
All reactions