Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
Is it possible to pass both custom validation function in validate and do yup/zod schema validation in React-hook-form

Is it possible to execute both custom validation function which will be passed to validate object in react hook form and yup/ zod schema validation ?

I have a custom rules object from where I would pick up few rules which will be complex validations along with this I would need a regular yup/zod schema validation.

When I run a simple sample, my custom validations won't work if schema is given.

My custom validate function is below, this is just an example. In actual these validate functions will be quite complex and will be in some common file where it will be reused.

<Controller
           name="retype_password"
           control={control}
           rules={{ validate: {isValueEqual: ruleSet.isValueEqual(getValues('password')) } }} 
// Run this custom function along with schema validation like string, required, min , max
           render={({ field, fieldState: {error}, formState }) => 
                <MyTextField placeholder="Retype password here" error={!!error} {...field} />
           }
/>

Please guide, will be really helpful & appreciated

Thank you

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!