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

246
Visualizações
I have used <iFrame> tag in my react app but it will open the same file even the file url is different, but if I used <a> tag it open perfectly

item.image URL is coming form the API but when I try to map in <a> tag it will work fine which is for the download icon but for the view icon it will open the same file. enter image description here

data.map(item => {
 return <>
     <Modal open={open} onClose={onCloseModal} center>
       <div className="modalContent">
           <iframe src={item?.image}>
           </iframe>      
       </div>
    </Modal>

 <a href={item?.image} target="_blank" download >
   <span className="IconBoc">
        <AiOutlineDownload />
    </span>
 </a>
</>
})

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You should be using <img> instead of <iframe>.

iframes are to embed other websites into your website.

For media there already exist tags like <img> or <video>.

Try:

data.map(item => {
 return <>
     <Modal open={open} onClose={onCloseModal} center>
       <div className="modalContent">
           <img src={item?.image} />
       </div>
    </Modal>

 <a href={item?.image} target="_blank" download >
   <span className="IconBoc">
        <AiOutlineDownload />
    </span>
 </a>
</>
})
about 4 years ago · Juan Pablo Isaza Relatório
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