import { a as useState, b as useRef, u as useEffect } from './bdb97fd3.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=8552c925.js.map
