條件影象源

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

如果路徑在 imagePath 中可用,則它將被分配給源,否則將分配預設影象路徑。