import React from "react";
import ReactDOM from "react-dom";
var bImg = prompt("Enter the URL of the image you want to set as the background:");
const bStyle = {
backgroundImage: "url(bImg)"; // The link is stored here
};
const rootElement = document.getElementById("root");
ReactDOM.render(
<div style={bStyle}> // Even though it's stored here, the background image isn't showing
<h1>Hello world!!</h1>
</div>,
rootElement
);
Everything else seems to be functioning correctly, but the background image doesn't load from the URL entered in the prompt. An error indicates that 'bImg' has a value assigned to it, but it isn't being used.