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

151
Visualizações
React Dropzone accept="image/jpeg" is blocking other related function when it executes

I am using Dropzone from react-dropzone and want to upload only JPED files. When I use accept="image/jpeg" on file opening dialog only JPEG files appearing but it is blocking other relating function incide onDrop If user uploads other format files like png, pdf it should alert error message:

const ALLOWED_FORMAT = 'image/jpeg'
       if (!ALLOWED_FORMAT.includes(acceptedFiles[i].type)) {
          alert("Onlu JPEG files accepted")

          break;
        }

if I remove accept="image/jpeg" from Dropzone this function works as expected but I need to run both. If user uploads other formats this alter function should execute and alert error message! Where should I change or what should I add/remove?

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