Conditional Image Source

suggest change
<Image style={[this.props.imageStyle]}
        source={this.props.imagePath
        ? this.props.imagePath
        : require('../theme/images/resource.png')}
    />

If imagePath is set, it is used as source. Otherwise the default image is used. imagePath must already be an image source (a require(...) result or {uri: ...}), not a plain file-path string.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents