const [endTime, setEndTime] = useState<number>();
const [timerValue, setTimerValue] = useState<Time>({
hours: 0,
minutes: 0,
seconds: 0
});
useEffect(() => {
const endTimeUnix = timestamp + minutesLimit * 60;
setEndTime(endTimeUnix * 1000);
const timerInterval = setInterval(timer, 1000);
return () => clearInterval(timerInterval);
}, [timestamp, minutesLimit]);
setEndTime(endTimeUnix * 1000);
console.log('endTime', endTime);
const timerInterval = setInterval(timer, 1000);