How to use correctly zod validation scheme inside form?
Hello everyone, I have this validation scheme:
I want to use it inside the form, I did it this way, but it doesn't work correctly, tell me how to use validation correctly in this case?
1 Reply
genetic-orange•14mo ago
We have the concept of
validatorAdapter
to make it easy to integrate zod so you just need to pass the schema, no extra logic required.
Have a look here: https://tanstack.com/form/latest/docs/framework/react/guides/validation#adapter-based-validation-zod-yup-valibotForm and Field Validation | TanStack Form React Docs
At the core of TanStack Form's functionalities is the concept of validation. TanStack Form makes validation highly customizable:
You can control when to perform the validation (on change, on input, on blur, on submit...)