Answers for "react native return null"

9

how to use if else inside jsx in react

renderElement(){
   if(this.state.value == 'news')
      return <Text>data</Text>;
   return null;
}

render() {
    return (   
        <View style={styles.container}>
            { this.renderElement() }
        </View>
    )
}
Posted by: Guest on May-27-2020
0

react native return null

return (null);
Posted by: Guest on July-19-2021

Code answers related to "react native return null"

Code answers related to "Javascript"

Browse Popular Code Answers by Language