javascript canvas html elements add event listener to element inside canvas code example
Example: canvas event listener js
onMouseOver={() => {
// function goes here
}}
onMouseOut={() => {
// function goes here
}}
onMouseMove={() => {
// function goes here
}}
onMouseDown={() => {
// function goes here
}}
onMouseUp={() => {
// function goes here
}}