JSFiddle - React, Tailwind, and code Playground
HTML
<canvas id="game" style="width: 512px; height: 512px">
</canvas>
JavaScript
var canvas = document.getElementById('game')
var g = canvas.getContext('2d');
g.clearRect(0,0,512,512);
g.fillStyle = 'red';
g.fillRect(0,0,50,100);
g.strokeStyle = "blue";
g.lineWidth = 2;
g.beginPath()
g.rect(100,50,100,50)
g.stroke()