From 2699ce8dfe7fd17abce7482ab2f8841b19419150 Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Thu, 29 Apr 2021 21:41:51 +0200 Subject: [PATCH] fix "TouchEvent is not defined" --- src/core/usePointer.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/usePointer.ts b/src/core/usePointer.ts index 35d8e66..f4d1de5 100644 --- a/src/core/usePointer.ts +++ b/src/core/usePointer.ts @@ -100,7 +100,8 @@ export default function usePointer(options: PointerConfigInterface): PointerInte function updatePosition(event: TouchEvent | MouseEvent) { let x, y - if (event instanceof TouchEvent && event.touches && event.touches.length > 0) { + // @ts-ignore + if (event.touches && event.touches.length > 0) { x = (event).touches[0].clientX y = (event).touches[0].clientY } else {