I am a learning react native and trying to apply an if condition based on map value but getting error
render() {
return (
<View>
<Text>My List view</Text>
{
this.state.fruits.map((item) => (
{ if(item.id % 2 == 0) {
console.log("Even Number")
}}
<Text key={item.id}>
{item.id + ". " + item.name}
</Text>
))
}
</View>
)
}
