HOME

JavaScript

setInterval
useEffect(() => {
  const interval = setInterval(() => {
    // code
  }, 1000);
  return () => clearInterval(interval);
})