react-hotkeys: [BUG] Global hotkeys throwing errors after dom changes
Describe the bug
When using the GlobalHotKeys component it gives errors after some components mount and unmount.
using any keys seems to give the following error even though the hotkeys are still working and actions are triggering as usual:

How are you using react hotkeys components? (HotKeys, GlobalHotKeys, IgnoreKeys etc) GlobalHotKeys
Expected behavior it should not error out.
Platform (please complete the following information):
- Version of react-hotkeys v2 prerelease 4
- Browser chrome
- OS: [windows, macos]
Are you willing and able to create a PR request to fix this issue?
I did a quick dive and by adding || [] at the end of this line, simply solves the issue in our usecase. not sure if this fix is right or if any deeper changes are needed
APPLICABLE TO v2.0.0-pre1 AND ABOVE: ======================
Include the smallest log that includes your issue:
Types seem to be broken so I couldn’t import the configure function
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20 (7 by maintainers)
Commits related to this issue
- 🐛 Fix #150: Reset global handler resolution state when a new GlobalHotKeys component is mounted — committed to greena13/react-hotkeys by greena13 5 years ago
Fix is now available in v2.0.0-pre6.
Thanks for taking the time to write this issue up and look into its cause, @hadihallak.
I’ll take a closer look into how this may be occurring and report back.
I’ve created a separate issue to track the fact that the
configurefunction is not exported from the TypeScript file.