is it good to use the index desctructured from map callback as a key react code example
Example 1: map function in react
function NameList() {
const names = ['Bruce', 'Clark', 'Diana']
return (
<div>
{names.map(name => <h2>{name}</h2>)}
</div>
)
}
Example 2: jsx map with index
materials.map((material,index) => console.log(index +" = " + material + " = " + materials[index]));