From 509d1d7235af9d759f4d5521032e2d00ba15f5ad Mon Sep 17 00:00:00 2001 From: Vxrcel Date: Wed, 24 Jul 2024 17:21:43 +0100 Subject: [PATCH] fix types --- src/components/error/Particles404.tsx | 2 ++ src/lib/utils.ts | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/error/Particles404.tsx b/src/components/error/Particles404.tsx index 352d25c9f..07b5101e1 100644 --- a/src/components/error/Particles404.tsx +++ b/src/components/error/Particles404.tsx @@ -24,6 +24,7 @@ const Particles404 = () => {

@@ -33,6 +34,7 @@ const Particles404 = () => {

diff --git a/src/lib/utils.ts b/src/lib/utils.ts index c6e78b8a0..a08136474 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -26,10 +26,9 @@ export function formatPrice( const letters = "!ABCDEFGHIJKLMNOPQRSTUVWXYZ#"; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export const handleMouseEnter = (element: any) => { - if (!element) return; - element = element.target as HTMLElement; +export const handleMouseEnter = (event: MouseEvent) => { + if (!event) return; + const element = event.target as HTMLDivElement; let iteration: number = 0; const speed: number = element.dataset.value!.length > 7 ? 30 : 60; @@ -46,7 +45,8 @@ export const handleMouseEnter = (element: any) => { const deltaTime = timestamp - lastTimestamp; if (deltaTime >= speed) { - element.textContent = [...element.textContent!] + // @ts-expect-error Hacking the type + element!.textContent! = [...element!.textContent!] .map((_: string, index: number) => { if (index < iteration) { return element.dataset.value![index];