JSFiddle - React, Tailwind, and code Playground
HTML
<canvas id="thecanvas"></canvas>
JavaScript
var img = new Image();
var cv = document.getElementById('thecanvas');
img.src = 'http://www.photographyblogger.net/wp-content/uploads/2009/12/Picture-in-a-picture4.jpg';
img.onload = function() {
var ctx = cv.getContext('2d');
//cv.style.width = img.width + 'px';
//cv.style.height = img.height + 'px';
cv.width = img.width;
cv.height = img.height;
ctx.drawImage(img, 0, 0);
};