score:6

Accepted answer
render() {
    const {images} = this.props;

    return (
        images.map((img, index) => (
            <Image style={style} img={img} text={index} key={img} />
        ))
    );
}

score:1

const getBackgroundImage = (image) => {
  return { backgroundImage: `url(${image})` };
}

<div style={[style, getBackgroundImage(img1)]}>1</div>

Related Query

More Query from same tag