I have an array which has components in this structure
let array = [
{
id: uniqueKeyFunction(),
element: <Component key={uniqueKeyFunction() />} />
}
]
I would like to pass that id as a prop to the component, maybe like add it in the map function in the render. Currently the map function looks like
array.map(arr=>arr.element)
Is there a way to add a prop in this structure since I may not be able to add it at the array level?