'how to show the background image dynamically for the props

I am working in react now I want to add the background image from the props. I write the function base component which is

export default function City(props) {
  return (
    <div className='col-lg-4 ' style={{backgroundImage:`url(props.city)`}}>
      <p>{props.img}</p>
    </div>
  )
}

now what I do to show the background image of the div.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source