Cannot read properties of null (reading 'currentTime')

53 Views Asked by At

i wanna leave page but when i do it throws this error however everything works correctly!

here is my code:

const repeat = useCallback(() => {
  const time = audioRef.current.currentTime;
  setTimeProgress(time);
  progressRef.current.value = (time / duration) * 100;

  playAnimationRef.current = requestAnimationFrame(repeat);

}, [audioRef, progressRef, duration]);

0

There are 0 best solutions below