Reactjs – The state is not updating correctly inside setInterval of useEffect in react
I'm facing issue in updating the setStartTime inside setInterval function. I want to update the startTime every minute. To update that, I've created a useRef and storing the value in timeRef.current. Every minute, startTime is getting updated. const [startTimeOffsetMins, setStartTimeOffsetMins]…