react-use-mouse-position
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -14,4 +14,5 @@ import { useState, useEffect } from "react"; | ||
const updateTouchPosition = ev => { | ||
if (ev?.changedTouches?.length > 0) { | ||
let touch = ev?.changedTouches[0]; | ||
let touches = ev.changedTouches || []; | ||
if (touches.length > 0) { | ||
let touch = touches[0]; | ||
setMousePosition({ mouseX: touch.clientX, mouseY: touch.clientY }); | ||
@@ -18,0 +19,0 @@ } |
{ | ||
"name": "react-use-mouse-position", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "A light npm package to track mouse position", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
5640
33