adding a if stement in jsx
renderElement(){
if(this.state.value == 'news')
return <Text>data</Text>;
return null;
}
render() {
return (
<View style={styles.container}>
{ this.renderElement() }
</View>
)
}render() {
const isLoggedIn = this.state.isLoggedIn;
return (
<div>
The user is <b>{isLoggedIn ? 'currently' : 'not'}</b> logged in. </div>
);
}render() {
return (
<View style={styles.container}>
{this.state.value == 'news'? <Text>data</Text>: null }
</View>
)
}
Also in JavaScript:
- how to edit /.prettierrc.json file pretter
- new date() javascript
- select second column of table using d3.js
- nuxtjs http multiple proxy
- manual avanzado java script
- npm font awesome 5 angular 7
- Exception in thread "main" org.openqa.selenium.JavascriptException:
- node if file exists
- python get json content from file
- javascript var in quotes
- node command get to much time
- clear cookies js
- js remove readonly attribute
- javascript detect click outside of element
- VM1188:1 Uncaught TypeError: $ is not a function at <anonymous>:1:1
- Find channel discord js
- hamburger menu html and css
- javascript convert date from mm/dd/yyyy to yyyymmdd
- react dynamic settings
- javascript get cpu cores
- regular expression escape character
- javascript clear div
- check for duplicates in array javascript
- firebase auth sign out javascript