'map this object with react [duplicate]
(2) [{…}, {…}]
0:
data: {arrivaldate: gt, country: 'Venezuela', suc: 'Laboratorio Venequip', testtype: 'antigeno', dest: 'Andorra', …}
id: "3C0wQaN3chtB7BPV2GS7"
[[Prototype]]: Object
1:
data: {address: 'san jacinto', arrivaldate: gt, gender: 'masculino', suc: 'aerolab', departureDate: gt, …}
id: "uF7XfnXIfqwaedGjwMMa"
i want to map to a cards where i can display the id, and the data
this is the code im doig but the "nombre" is blank.
{data.map((item, idx) => (
<div className=" p-6 mb-5 max-w
bg-white rounded-lg border
border-gray-200 shadow-md
dark:bg-gray-800
dark:border-gray-700
dark:hover:bg-gray-700">
<ul>
<li key={idx}>
<p>Nombre:{item[idx].id}</p>
</li>
</ul>
</div>
))}
also if a i do a log with this sintax:
data[0].id
bring the id of the object but in the map function does nothing and crash..
im new in react trying to learn.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
