Answers for "map each element to jsx"

0

map an array in react

//lets say we have an array of objects called data
<div className="sample">
  {data.map((item)=>{
    return(
  <div key={item.id} className="objectname">
    <p>{item.property1}</p>
    <p>{item.property2}</p>
  </div>
    );
  });
</div>
Posted by: Guest on December-03-2021
-1

jsx map with index

materials.map((material,index) => console.log(index +" = " + material + " = " + materials[index]));
Posted by: Guest on January-10-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language