Add "end" to useEffect

This commit is contained in:
Utku authored and GitHub committed 2022-08-01 16:46:57 +03:00
1 parent 79941c654b
commit 7b4c930a5c
1 file changed
+2 -1
+2 -1
View File
@@ -57,7 +57,8 @@ const useCounter = ({ name, start = 0, end, duration = 2, saveState = true }: Us
if (saveState && value == end) {
setLastValue(name, end);
}
}, [value]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [end, value]);
if (start === end) return end;