*I am a new for react native and JavaScript . This not a advance quection.I just try to compare a string like in java .but it doesn't work .when run this it also print the if conditions like a sting .
<FlatList
data={data}
keyExtractor={({id },index) => id}
renderItem={({item}) =>(
<View style={styles.container}>
if({item.id} ==1){
<Text style={styles.textStyle1}>ID is : {item.id}</Text>
}else{
<Text >ID is : {item.id}</Text>
}
<Text style={styles.textStyle2}>Title is :{item.title}</Text>
<Text style={styles.textStyle3}>releaseYear is : {item.releaseYear}</Text>
</View>
)}
/>
* error
Error: Text strings must be rendered within a <Text> component.
* output in web
[![enter image description here][1]][1]
[1]: https://i.sstatic.net/UkHS6.png