Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-hotkeys-hook

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hotkeys-hook - npm Package Compare versions

Comparing version 4.0.4-0 to 4.0.4-1

dist/index.cjs

5

package.json
{
"name": "react-hotkeys-hook",
"version": "4.0.4-0",
"version": "4.0.4-1",
"repository": "https://JohannesKlauss@github.com/JohannesKlauss/react-keymap-hook.git",
"homepage": "https://johannesklauss.github.io/react-hotkeys-hook/",
"author": "Johannes Klauss",
"main": "dist/index.js",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",

@@ -9,0 +10,0 @@ "files": [

6

src/useHotkeys.ts
import { HotkeyCallback, Keys, OptionsOrDependencyArray, RefType } from './types'
import { useCallback, useLayoutEffect, useRef } from 'react'
import { useCallback, useEffect, useLayoutEffect, useRef } from 'react'
import { parseHotkey, parseKeysHookInput } from './parseHotkeys'

@@ -22,2 +22,4 @@ import {

const useSafeLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect
export default function useHotkeys<T extends HTMLElement>(

@@ -41,3 +43,3 @@ keys: Keys,

useLayoutEffect(() => {
useSafeLayoutEffect(() => {
if (memoisedOptions?.enabled === false || !isScopeActive(enabledScopes, memoisedOptions?.scopes)) {

@@ -44,0 +46,0 @@ return

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc