I want to add a background image in React.js by using a style definition, which works:
let imgUrl = \'images/berlin.jpg\' let styles = { root: {
If you use an image as background, is better to use the 'backgroundImage' property.
If you use the 'background' property, this may cause issues on reloading the component (e.g. 'cover' attribute will not apply properly).
Solution proposed:
let imgUrl = 'images/berlin.jpg';