From 78950cf19ecee76e4c34760a5aa43b69309e6d0c Mon Sep 17 00:00:00 2001 From: TFT Date: Tue, 31 Mar 2026 18:41:48 +0300 Subject: [PATCH] maybe fix the useCountUp hook --- src/hooks/useCountUp.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/hooks/useCountUp.ts b/src/hooks/useCountUp.ts index 7b4bb8b..83c700e 100644 --- a/src/hooks/useCountUp.ts +++ b/src/hooks/useCountUp.ts @@ -3,13 +3,11 @@ import { useEffect, useRef, useState } from "react"; interface UseCountUpOptions { - end: number; - duration?: number; - suffix?: string; - prefix?: string; + end: number; + duration?: number; } -export function useCountUp({ end, duration = 2000, suffix = "", prefix = "" }: UseCountUpOptions) { +export function useCountUp({ end, duration = 2000 }: UseCountUpOptions): { ref: React.RefObject; count: number } { const [count, setCount] = useState(0); const [hasStarted, setHasStarted] = useState(false); const ref = useRef(null); @@ -51,7 +49,5 @@ export function useCountUp({ end, duration = 2000, suffix = "", prefix = "" }: U requestAnimationFrame(animate); }, [hasStarted, end, duration]); - const display = `${prefix}${count}${suffix}`; - - return { ref, display, count }; + return { ref, count }; }