How to do dynamic background image,

A better solution might be to use an actual image element, and place your content over it by placing both as children of a grid element, with both set to occupy the first column position so that they overlap.

But you can also set the style to something like (watch out for the smart quote chars here)

{
“backgroundImage”: “url(‘https://example.com’)”,
“backgroundSize”: “cover”,
“backgroundPosition”: “center”,
“backgroundRepeat”: “no-repeat”
}
1 Like