@tamagui/use-escape-keydown
Advanced tools
Comparing version 1.111.8 to 1.111.9
import React from "react"; | ||
import { useCallbackRef } from "@tamagui/use-callback-ref"; | ||
function useEscapeKeydown(onEscapeKeyDownProp) { | ||
var ownerDocument = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() { | ||
var _globalThis; | ||
return (_globalThis = globalThis) === null || _globalThis === void 0 ? void 0 : _globalThis.document; | ||
}(), onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp); | ||
React.useEffect(function() { | ||
var handleKeyDown = function(event) { | ||
var ownerDocument = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function () { | ||
var _globalThis; | ||
return (_globalThis = globalThis) === null || _globalThis === void 0 ? void 0 : _globalThis.document; | ||
}(), | ||
onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp); | ||
React.useEffect(function () { | ||
var handleKeyDown = function (event) { | ||
event.key === "Escape" && onEscapeKeyDown(event); | ||
}; | ||
return ownerDocument.addEventListener("keydown", handleKeyDown), function() { | ||
return ownerDocument.addEventListener("keydown", handleKeyDown), function () { | ||
ownerDocument.removeEventListener("keydown", handleKeyDown); | ||
}; | ||
}, [ | ||
onEscapeKeyDown, | ||
ownerDocument | ||
]); | ||
}, [onEscapeKeyDown, ownerDocument]); | ||
} | ||
export { | ||
useEscapeKeydown | ||
}; | ||
//# sourceMappingURL=index.js.map | ||
export { useEscapeKeydown }; | ||
//# sourceMappingURL=index.native.js.map |
{ | ||
"name": "@tamagui/use-escape-keydown", | ||
"version": "1.111.8", | ||
"version": "1.111.9", | ||
"types": "./types/index.d.ts", | ||
@@ -21,6 +21,6 @@ "main": "dist/cjs", | ||
"dependencies": { | ||
"@tamagui/use-callback-ref": "1.111.8" | ||
"@tamagui/use-callback-ref": "1.111.9" | ||
}, | ||
"devDependencies": { | ||
"@tamagui/build": "1.111.8" | ||
"@tamagui/build": "1.111.9" | ||
}, | ||
@@ -30,3 +30,3 @@ "exports": { | ||
".": { | ||
"react-native-import": "./dist/esm/index.native.mjs", | ||
"react-native-import": "./dist/esm/index.native.js", | ||
"react-native": "./dist/cjs/index.native.js", | ||
@@ -33,0 +33,0 @@ "types": "./types/index.d.ts", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13116
15
168
+ Added@tamagui/use-callback-ref@1.111.9(transitive)
- Removed@tamagui/use-callback-ref@1.111.8(transitive)