Answers for "react image replace background"

0

change background image through props

style={{ backgroundImage: `url(${props.backgroundImage})` }}
  
  nouman
Posted by: Guest on November-03-2021
0

how to change background image dynamically in react

render: function() {
  var divImage = {
    backgroundImage : "url(" + this.state.song.imgSrc + "),url(" + this.state.nextImgSrc + ");" 
  };

  return (
    <li>
      <div ref="image-pane" className="player" style={divImage}></div>
    </li>
  )
}
Posted by: Guest on February-05-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language