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>
)
}
Also in JavaScript:
- angular serve
- javascript whitespace strip
- nodejs oauth2 request
- moment for react
- como saber cuando un link cambia angular
- get only numbers regex javascript
- for in loops javascript
- how to calculate average of array in javascript
- change version node centos
- change id in jquery
- react native list view
- jquery don't empty specific form field after submit
- js hash table example
- immutable values
- how to install node js in ubuntu
- jquery number format comma
- Javascript append item to array
- node eslint
- javascript set tooltip
- appendchild multiple elements
- string split javascript newline
- toggle element javascript
- js replace quotes
- javascript .slice() function