React can render an array of Elements, so you just need to create an array and assign it to a variable contents. I made an example using map.
render: function() {
console.log(this.state.list);
contents = this.state.list.results.map(function (item) {
return (
<View key={item.user.email} style={ styles.content }>
<Text>{item.user.email}</Text>
</View>
);
});
return (
<View style={ styles.container }>
<View style={ styles.header }>
<Text style={ styles.headerText }>XXX</Text>
</View>
<View style={ styles.content }>
{ contents }
</View>
</View>
);
}
And also: when you have an array of elements in React, you must provide a unique attribute keyfor each element in the array. Understand why . In this case, I use item.user.emailas a unique identifier, but you can use a different attribute, just make sure it is unique ( item.user.md5promises)