JSFiddle - React, Tailwind, and code Playground
HTML
<CANVAS id="testCanvas" width="200px" height="200px"> </CANVAS>
CSS
#testCanvas {
position: absolute;
border: 1px blue solid;
}
JavaScript
ctx = document.getElementById("testCanvas").getContext("2d");
ctx.strokeStyle= "#000000";
ctx.beginPath();
ctx.moveTo(100,50);
ctx.lineTo(25,175);
ctx.lineTo(175,175);
ctx.lineTo(100,50);
ctx.stroke();
ctx.endPath();