Add "end" to useEffect

This commit is contained in:
Utku
2022-08-01 16:46:57 +03:00
committed by GitHub
parent 79941c654b
commit 7b4c930a5c

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;