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

246
Vistas
How to replace URL.createObjectURL() for blob cases

I have the function below and using the deprecated URL.createObjectURL() method:

const downloadExceptionFile = async () => {
    const resp = await getExceptionFile();

    const link = document.createElement('a');
    link.setAttribute('download', 'excecoes.xlsx');
    link.href = URL.createObjectURL(new Blob([resp.data]));
    document.body.appendChild(link);
    link.click();
    link.remove();
  };

I`m using react, i try use this.srcObject and this.src as recomended in HTMLMediaElement.srcObject documentation, but, i just got an undefined error in my face.

How can i replace URL.createObjectURL() since this method its deprecated?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Long story short:

You don't need to change that code since URL.createObjectURL() is not deprecated.

The specific use case of creating an object URL to attach to a media element (e.g. <video>) is, and for that you should use .srcObject instead.

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