User1034446946 posted
hi
I have a functional component which use react-lodash Map to iteerate through an object which is a list of objects, but i would like an index in it and I am going round in circles
return (
<nav>
<ul>
<IsEmpty
value={data}
yes="Empty list"
no={() => (
<Map collection={data} iteratee={(obj, key) =>
<li>{index}</li>
}
/>
)}
/>
</ul>
</nav>
)
i know i could use my keys but my keys are descriptive and i would prefer my index to be numeric, any thoughts would be appiciated