I have a react app, and I am trying to detect the position of a touch event on a canvas. I use the following function :