-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Context issue #1
Comments
Hi @MilosJo, |
Hey @JohannesKlauss Well, it is not invoking my function |
@MilosJo That is because you are not invoking the function at all: console.log('esc') || cart.toggleShowCart You have to invoke the function inside the callback, since it is not the callback itself: useHotKeys('esc', () => console.log('esc') || cart.toggleShowCart()); |
@JohannesKlauss |
Can you please provide a working codebox or pen example, where this issue is reproduced? Since the |
Hey @JohannesKlauss |
Add callback to useEffect's second argument
Update scoping-hotkeys.mdx, expect to except
Hey there,
I really liked the idea of your API, but I have ran into an issue.
React version: "16.8.1"
This is the component where I use it.
cart
is from my Context andtoggleShowCart
is a method on it, which works just fine."esc"
gets logged to the console when I press it.Regards,
Milos
The text was updated successfully, but these errors were encountered: