For this we can use ternary operator or if there is only one condition then "&&" operator .Like this:-
//This is for if else
render() {
return (
<View style={styles.container}>
{this.state == 'news') ?
<Text>data</Text>
: null}
</View>
)
}
//This is only for if or only for one condition
render() {
return (
<View style={styles.container}>
{this.state == 'news') &&
<Text>data</Text>
}
</View>
)