diff --git a/src/components/Dashboard/common/KeyboardShortcut.jsx b/src/components/Dashboard/common/KeyboardShortcut.jsx index 9afd4d3..9913d3a 100644 --- a/src/components/Dashboard/common/KeyboardShortcut.jsx +++ b/src/components/Dashboard/common/KeyboardShortcut.jsx @@ -1,4 +1,4 @@ -import { useEffect, useRef, cloneElement, useMemo, useState } from 'react' +import { useEffect, useRef, cloneElement, useMemo } from 'react' import PropTypes from 'prop-types' import { Popover, Typography } from 'antd' @@ -50,18 +50,12 @@ const KeyboardShortcut = ({ const childRef = useRef() const pressedKeysRef = useRef(new Set()) const shortcutKeys = useMemo(() => parseShortcut(shortcut), [shortcut]) - const [pressedKeys, setPressedKeys] = useState([]) useEffect(() => { - const syncPressedKeys = () => { - setPressedKeys([...pressedKeysRef.current]) - } - const handleKeyDown = (event) => { const key = getPressedKey(event) if (key) { pressedKeysRef.current.add(key) - syncPressedKeys() } if (log) { @@ -83,7 +77,6 @@ const KeyboardShortcut = ({ const key = getPressedKey(event) if (key) { pressedKeysRef.current.delete(key) - syncPressedKeys() } }