JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<head>
<body>
<h1>sensing clicks on the canvas</h1>
</body>
</head>
</html>
JavaScript
document.addEventListener('mousedown', onDown, false);
let cX = 0;
let cY = 0;
function onDown(e) {
cX = e.pageX;
cY = e.pageY;
alert (cX + ", " + cY);
}