i have started just learning react js and i'm making a carousel where i want to set the picture as a bgImg putting it inside url() in a div but picturing is not getting render but when i'm puting the same in tag it is coming
import { Banners } from '../Assignment/carasoul_data'
<div className="carousel-area" style={{backgroundImage : `url(${Banners[0]})`}}>
//picture not getting render
some have suggested to use required but that also didn't worked for me
<div className="carousel-area" style={{backgroundImage: `url(${require(Banners[0])})`}} >
</div>
i have tried this too
"url(" + Banners[0]+ ")"
My images list which i want to render
import banner1 from'../Assignment/carasoul/Web assignment.jpeg'
import banner2 from'../Assignment/carasoul/Web assignment2.jpeg'
import banner3 from'../Assignment/carasoul/Web Banner3.jpeg'
import banner4 from'../Assignment/carasoul/Web Banner4.jpeg'
export const Banners =[banner1,banner2,banner3,banner4]