JSFiddle - React, Tailwind, and code Playground

by Tân Nguyễn

CSS

img {
    width: 150px;
    height: 100px;
}

JavaScript

var location = 'https://images.unsplash.com/photo-1474511320723-9a56873867b5?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80';

fetch(location).then(response => response.blob()).then(blob => {
    var url = URL.createObjectURL(blob);
    var image = document.createElement('img');

    image.src = url;
    
    document.body.appendChild(image);
    console.log(url)
});