Hello
I have recently started React, and I am struggling about intricating two map functions (probably not the best way to do the job but there is a long road still to make)
My question is : I would like to pass the first index i to the second map function ("here it is" comment in the code) but then I don't know how to access it inside the function.
{images.map((index, i) => {
return (
<div className="item" key={i}>
<img src={`./images/${myjson.images[index].name}`} alt="" />
<div className="allBoxes">
{myjson.images[index].palette.map((index, i) => {
console.log(i)
return (
<div
key={i}
className="colorBox"
style={{ backgroundColor: index }}
onClick={calculateNewList}
/>
);
},i)} // here it is __________________________
</div>
</div>
);