Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

202
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda