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

249
Vistas
Need to reference/access Yup.ref() value within the message of yup min and max validations

I have the following Yup validation and unsure how to reference the Yup.ref(a) value within the message of that .min() and .max(), i.e.:

  checkPercent: Yup.number()
    .when("summaryFlag", {
      is: true,
      then: Yup.number()
        .typeError('Value must be a number')
        .required('Value is required')
        .positive()
        .min(Yup.ref("percentLower"), `{The value must be > xx`)
        .max(Yup.ref("percentUpper"), `{The value must be < yy`)
  })

Using the above, how can I replace xx in my .min message with the actual value of Yup.ref("percentLower") ?

The same for yy to be replaced with the value of Yup.ref("percentUpper") ?

I tried using template literals syntax but it didn't work, i.e.:

.min(Yup.ref("percentLower"), {The value must be > ${Yup.ref("percentLower")})

about 4 years ago · Juan Pablo Isaza
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