'use strict';

var React = require('react');
var index_module = require('../../react-use-callback-ref/dist/index.module.js');

/**
 * Listens for when the escape key is down
 */ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
    const onEscapeKeyDown = index_module.useCallbackRef(onEscapeKeyDownProp);
    React.useEffect(()=>{
        const handleKeyDown = (event)=>{
            if (event.key === 'Escape') onEscapeKeyDown(event);
        };
        ownerDocument.addEventListener('keydown', handleKeyDown);
        return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown)
        ;
    }, [
        onEscapeKeyDown,
        ownerDocument
    ]);
}

exports.useEscapeKeydown = $addc16e1bbe58fd0$export$3a72a57244d6e765;
//# sourceMappingURL=index.module.js.map
