import { useState, useCallback } from 'react';
import useIntersectionObserver from "../../../hooks/useIntersectionObserver/index.js";
const useIsSticky = function useIsSticky() {
  const [isSticky, setIsSticky] = useState(false);
  const stickyCallback = useCallback(e => {
    setIsSticky(!e.isIntersecting);
  }, []);
  const ref = useIntersectionObserver({
    callback: stickyCallback
  });
  return [ref, isSticky];
};
export default useIsSticky;