I try to convert an array of objects into a list. For now, I just want to convert a "type" property of my object into a list item, but it doesn't work.
Here is my code:
constructor(props){
super(props);
this.travelRawdata = [{type:15}];
}
render(){
return(
<ul>
{this.travelRawdata.forEach(element => <li>{element.type}</li>)}
</ul>
);}
I don't get any output. If I use console.log(element.type) it works fine, so I think there is something wrong with my HTML tags?