JSFiddle - React, Tailwind, and code Playground

HTML

<body>
<canvas id="myCanvas" width="690px" height="460px">
К сожалению ваш браузер не поддерживает элемент canvas:(
</canvas>
 </body>

JavaScript

$(document).ready(function(){
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
var mouse = {
    x: 0,
    y: 0
}
c.onmousemove = function(e) {
        mouse = {
            x: e.pageX - this.offsetLeft,
            y: e.pageY - this.offsetTop
        };
    }
function start_drawing(){
ctx.clearRect(0,0,690,460);
ctx.moveTo(0,0);
ctx.lineTo(mouse.x,mouse.y);
ctx.stroke();
}
    setInterval(start_drawing,20);
});