I'm using the map
function to iterate through an array in the state
. My code is:
theList(){
return this.state.lists.map((list) => {
return(
<View style={this.state.listStatus[list.id].status?styles.list:styles.list2}>
<Text>{list.name}</Text>
</View>
)
})
}
How can I put the list.id in the this.state.listStatus[here]
?