I am trying to map data that I have in an array, however, the data is not mapped when I run the code. If I log the data (serials variable), it logs the variables that I would like to map (screenshot below). Does anyone have any suggestions about why the data isn't mapped?
numberList() {
const uid = this.state.user.uid;
const serialRef = db.ref(uid + "/serials");
serialRef.on("value", (serial_numbers)=> {
const serials = [];
serial_numbers.forEach((serial_number)=> {
serials.push({s:serial_number.val()});
});
console.log(serials);
return (
<ul>
{serials.map((number) => <li>{number}</li>)};
</ul>
);
});
}
render (){
return (
<button onClick={this.numberList}>Cards</button>
)};
}
Thanks in advance!
