JSFiddle - React, Tailwind, and code Playground
JavaScript
var canvas = document.getElementById("ex1");
var context = canvas.getContext("2d");
context.fillStyle = "#ff0000";
context.fillRect(10,10, 100,100);
context.strokeStyle = "#0000ff";
context.strokeRect(30,20, 120, 110);
context.clearRect(50, 30, 110, 35);