Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

284
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda