render() {
const Array = this.props.students.map((data) => {
return (
<button
key={data.name}
//key={data.birthDate}
//key={data.age}
//key={data.class}
>{data.name}</button>
);
});
return (
<div>
{Array}
<StudentInfo name = {"Amira"}/>
</div>
);
}
This is my code. Currently I'm trying to pass array data from that <button></button>
into <StudentInfo />
and replace the name = {"Amira"}
Can anyone help me with this?
Thank you.