![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
@daniel.husar/use-escape-key
Advanced tools
⚠️ Warning: hooks are not part of a stable React release yet, so use this library only for experiments
@danielhusar/use-escape-key
is a react custom-hook that will execute function when escape key is pressed
yarn add @daniel.husar/use-escape-key
This is a hook that lets you execute function when escape key is pressed.
Usage
import useEscapeKey from '@daniel.husar/use-escape-key';
const Component = (props) => {
useEscapeKey(() => console.log('I have pressed escape key!'));
}
First argument in useEscapeKey
is function that will be executed when escape key is pressed. The event object is passed into this function as argument.
Second optional argument is object for options:
Type: object
Default: 'window object'
This is useful if you don't want to bind event to current window, but for example to parent window (window.parent)
Type: array
Default: []
If you use in your function any values from the outer scope that change over time, you should provide them as dependencies so function will get executed with latest values. This get passed as second argument into useEffect
hook.
MIT © Daniel Husar
FAQs
React hook for escape key press
We found that @daniel.husar/use-escape-key demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.