import { b as useState, a as useRef, u as useEffect } from './4ccc6eeb.js';

function useHoverHook() {
  const [value, setValue] = useState(false);
  const ref = useRef(null);

  const handleMouseOver = () => {
    setValue(true);
  };

  const handleMouseOut = () => {
    setValue(false);
  };

  useEffect( // eslint-disable-next-line consistent-return
  () => {
    const node = ref.current;

    if (node) {
      node.addEventListener("mouseenter", handleMouseOver);
      node.addEventListener("mouseleave", handleMouseOut);
      return () => {
        node.removeEventListener("mouseenter", handleMouseOver);
        node.removeEventListener("mouseleave", handleMouseOut);
      };
    }
  }, [ref.current] // Recall only if ref changes
  );
  return [ref, value];
}

export { useHoverHook as u };
//# sourceMappingURL=1c3fc91c.js.map
