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

145
Vistas
How to get Json data array and object using fetch api in Reactjs

am new in ReactJs ,I have try to get data in Array inside of object data. but am unable to get data object.I fetch successfully 'data' array but not able to get inside of 'item.name and description'. Please give the solution step by step.

JSON data

    {
   "lastUpdate":0,
   "lanuage":"en",
   "data":[
      {
         "itemId":"8f90647f-fafe-47a5-8204-8197e07432da",
         "lastUpdate":1636440002,
         "item":{
            "name":"Hacivat Bundle",
            "description":"",
            "type":"bundle",
            "rarity":"epic",
            "series":null,
            "cost":"???",
            "upcoming":true,
            "images":{
               "icon":"https://dropin-bucket.mativecdn.com/cosmetics/br/8f90647f-fafe-47a5-8204-8197e07432da_kv88w8kp/icon.png",
               "featured":null,
               "background":"https://dropin-bucket.mativecdn.com/cosmetics/br/8f90647f-fafe-47a5-8204-8197e07432da_kv88w8kp/icon.png",
               "information":"https://dropin-bucket.mativecdn.com/cosmetics/br/8f90647f-fafe-47a5-8204-8197e07432da_kv88w8kp/icon.png"
            },
            "backpack":{
               
            },
            "obtained":"",
            "obtained_type":"none",
            "ratings":{
               "avgStars":3.49,
               "totalPoints":192,
               "numberVotes":55
            },
            "costmeticId":"8f90647f-fafe-47a5-8204-8197e07432da_kv88w8kp"
         }
      },
    ]
  }

Source code

    function Shop() {
  useEffect(() => {
    fetchitems();
  }, []);

  const [items, setItems] = useState([]);
  const fetchitems = async () => {
    const data = await fetch("https://fortnite-api.theapinetwork.com/upcoming/get"
    );
    const itemsdata = await data.json();
    console.log(itemsdata.data);
    setItems(itemsdata.data);
  };



  return (
    <div>
      {items.map(item => (
        <h1>{item.name}</h1>
      ))}
    </div>
  );

}

export default Shop;
about 4 years ago · Juan Pablo Isaza
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