react-hotkeys
react-hotkeys copied to clipboard
Plans for a useHotkeys hook?
Is your feature request related to a problem? Please describe. I love that hooks make functional components possible for just about everything. I also love react-hotkeys because of its lack of dependencies and it's options to present active hotkeys information to the user.
Describe the solution you'd like
Would love to get a useHotkeys
option for react hotkeys.
Describe alternatives you've considered Looked into the existing https://github.com/JohannesKlauss/react-hotkeys-hook which is just a super simple wrapper around hotkeys-js library. Seems okay, but doesn't seem as well maintained and doesn't have the ability to present the user with a menu of registered hotkeys
Really just trying to gauge plans/interest to build such a feature.
Hi @jordantomax,
I'd have to look into what's involved, but I'm open to the idea of supporting it. It seems to be the direction react
is headed, so react-hotkeys
should endeavour to support and remain consistent with that.
@greena13 - Any updates on this? I too would like to take advantage of hooks with this library!
We need this.! This library needs update
Would love to contribute to this. That would be amazing.
I ended up writing my own library - https://github.com/reaviz/reakeys
react-hotkeys-hook
seems to be catching up:
Download stats for react-hotkeys
(🟢) decline quite quickly at the start of 2021. Does anyone know where all those downloads go? I wonder if there are any other alternatives worth exploring.
@jordantomax to your point on
[
react-hotkeys-hook
] doesn't have the ability to present the user with a menu of registered hotkeys
They seem to support this now via const { hotkeys } = useHotkeysContext();
. You can provide descriptions to your hotkeys and then list them in some kind of a menu. The docs for this feature are missing though (https://github.com/JohannesKlauss/react-hotkeys-hook/issues/1104).