I added a media upload button for an image in the inspector. Now I would like to add this image as a background-image to my <div> like this:
style={ { backgroundImage: url(${ imgURL })
} }
but the style tag should only appear in frontend, if an image is selected. So I thought this could work with some conditional logic:
style={ imgURL ? { backgroundImage: url(${ imgURL })
} : none }
but now I get the error message that the block validation failed. Does anyone have any idea how to solve this?