import { useLayoutEffect } from "react";
const useKeydownListener = (ref, handleKeyDown) => {
  useLayoutEffect(() => {
    if (!ref) {
      return;
    }
    ref.addEventListener("keydown", handleKeyDown, { capture: true });
    return () => {
      ref.removeEventListener("keydown", handleKeyDown, { capture: true });
    };
  }, [ref, handleKeyDown]);
};
export {
  useKeydownListener
};
//# sourceMappingURL=use-keydown-listener.js.map
