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

285
Vistas
How can I show a message if a condition isn't met in React

There is a form that uses Yup for data validation, for a field there are several conditions, it must be numerical value between 1 and 10, a default value 5, it must show an error message if the input is a number outside of the range and another error message if there is no input.

  const schema = yup.object({
      myInput: yup.number().default(5).min(1).max(10).required('no input'),
      ...
    });

It shows the default value, 5, but when it is deleted and clicked on submit there is no message saying 'no input'.

Also, where should be added the error message if the input is outside of [1, 10] interval?

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