From 955a01ba4105bf9feb867b230a6a5038f13dc2fc Mon Sep 17 00:00:00 2001 From: gene-ht Date: Fri, 6 Sep 2024 04:25:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20fails=20to=20work=20in=20Next.js=20produ?= =?UTF-8?q?ction=20when=20delay=20isn=E2=80=99t=200.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/useCountUp.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/useCountUp.ts b/src/useCountUp.ts index 1ef3b233..ecb12645 100644 --- a/src/useCountUp.ts +++ b/src/useCountUp.ts @@ -113,12 +113,10 @@ const useCountUp = (props: UseCountUpProps): CountUpApi => { }); const maybeInitialize = useEventCallback((shouldReset?: boolean) => { - if (startOnMount) { - if (shouldReset) { - reset(); - } - start(); + if (shouldReset) { + reset(); } + start(); }); useEffect(() => {