Tutorial by Examples: conditional

A clean way to handle booleans is using an inline conditional with the a ? b : c ternary operator, which is part of Swift's Basic Operations. The inline conditional is made up of 3 components: question ? answerIfTrue : answerIfFalse where question is a boolean that is evaluated and answerIfTrue...
<View style={[(this.props.isTrue) ? styles.bgcolorBlack : styles.bgColorWhite]}> If the value of isTrue is true then it will have black background color otherwise white.
<Image style={[this.props.imageStyle]} source={this.props.imagePath ? this.props.imagePath : require('../theme/images/resource.png')} /> If the path is available in imagePath then it will be assigned to source else the default image path will be assigned.

Page 4 of 4