Setting a background Image With React Inline Styles 1

Setting a background Image With React Inline Styles

backgroundImage: `url(${Background})`

Here is what the above code is Doing:
1. We’re importing the Background image from the assets folder.
2. We’re creating a variable called BackgroundImage and setting it equal to the Background image.
3. We’re creating a variable called BackgroundImageStyle and setting it equal to a CSS style.
4. We’re setting the backgroundImage property of the CSS style to the BackgroundImage variable.

Similar Posts