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

159
Vistas
React Native - Access to object in array json

I know it's a stupid question, but I've been with this for a while and I can't solve it. I am trying to access this object which is inside an Array. Specifically to url. I Tried this ways:

  1. post.yoast_head_json.og_image.url
  2. post.yoast_head_json.og_image[0].url
  3. post.yoast_head_json.og_image['url']
  4. post.yoast_head_json.og_image.[0].url

Doing a console.log of post.yoast_head_json.og_image the following comes out:

Array [
  Object {
    "height": 427,
    "type": "image/jpeg",
    "url": "https://www.example.es/wp-content/uploads/2022/01/pexels-picjumbocom-196656.jpg",
    "width": 640,
  },
]
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I have already found the solution to my problem.

Solution:

        let data;
        const imageUrl = [];           
        
        posts.forEach ( (post)=> {
    
        if(post.yoast_head_json.og_image != undefined)
        {
            data = JSON.stringify(post.yoast_head_json.og_image);

            JSON.parse(data, (key, value) => {  
                let valueStr = String(value);
                if (valueStr.includes('https')) {
                    imageUrl.push(valueStr);
                }
            })
        }
    });
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