title: How to cancel download when the <img/> tag disppears?
body: <p>I have a simple tag <code>&lt;img url=&quot;myurl.com/123&quot;/&gt;</code>. Now, I use react to generate them with random URLs every second, and it always replaces the last one. I noticed that with a slow connection, the images will start loading, but not stop even when I replace the current tag. Instead, they will download the picture and do nothing with it. What I would want to happen, is that when the tag with this image disappears, the image stops loading and instead the next one starts. Is there a good way to do that? I know there is the <code>load=&quot;lazy&quot;</code> attribute, but this only prevents an image that isn't on the screen from loading, and won't actually cancel it.</p>