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

155
Vistas
Issue with conditionally rendering plyr-react media from json error

Trying to conditionally render different media (audio/video) from a JSON file in react but getting errors.

Here is the code:

   {surgeryData.map(data => (
      <div>
         <Plyr
            source={
               ((type = {data.type}),
               (sources = [
                  {
                     src = {data.media}
                  }
               ]))
            }
         />
      </div>
   ))}

Whether I use = after source or : react doesn't seem to like the nested data inside the source. Any solutions?

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

0

Per the documentation, source should be an object like this.

{surgeryData.map((data) => (
  <div>        
    <Plyr
      source={{
        type: data.type,
        sources: [
          {
            src: data.media
          }
        ]
      }}
    />
  </div>
 ))}
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