From 91c25f164a77cd0e2d30217d8e7acaaf14b2ce92 Mon Sep 17 00:00:00 2001 From: Charles Parmentier <32079518+Cpavrai@users.noreply.github.com> Date: Mon, 21 Oct 2024 14:54:29 +0200 Subject: [PATCH] fix: initial value check --- src/components/Rating.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Rating.tsx b/src/components/Rating.tsx index af790d6..513bbef 100644 --- a/src/components/Rating.tsx +++ b/src/components/Rating.tsx @@ -146,7 +146,7 @@ export function Rating({ }) useEffect(() => { - if (initialValue) dispatch({ type: 'MouseClick', payload: 0 }) + if (initialValue !== undefined) dispatch({ type: 'MouseClick', payload: 0 }) }, [initialValue]) const totalIcons = useMemo(() => (allowFraction ? iconsCount * 2 : iconsCount), [allowFraction, iconsCount])