JSFiddle - React, Tailwind, and code Playground
HTML
<img id="myImage">
JavaScript
var xhr = new XMLHttpRequest();
xhr.open('GET', 'http://i.imgur.com/sBJOoTm.png', true);
xhr.responseType = 'blob';
xhr.onload = function(e) {
if (this.status == 200) {
var blob = this.response;
document.getElementById("myImage").src=window.URL.createObjectURL(blob);
}
};
xhr.onerror = function(e) {
alert("Error " + e.target.status + " occurred while receiving the document.");
};
xhr.send();