text: import { useRef, useEffect } from 'react';
  var useInterval = function (callback, delay) {
      var latestCallback = useRef(function () { });
      useEffect(function () {
          latestCallback.current = callback;
      });
      useEffect(function () {
          if (delay !== null) {
              var interval_1 = setInterval(function () { return latestCallback.current(); }, delay || 0);
              return function () { return clearInterval(interval_1); };
          }
          return undefined;
      }, [delay]);
  };
  export default useInterval;
  