Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Invalid `HandlerSetter` type for `useGlobalEvent` hook #162
Comments
|
Hi @jacekk would you mind to open a PR? |
|
@antonioru I will try to find some time. Kinda busy days lately |
hehe I totally understand :) thank you very much, I really appreciate it |


Describe the bug
The following PR introduced some breaking change in typings: https://github.com/beautifulinteractions/beautiful-react-hooks/pull/156/files#diff-b52768974e6bc0faccb7d4b75b162c99R19
I've tried the following, but of course, it is not working properly. But satisfies the TS compiler😸
Possible workaround
Use the third param of
useGlovalEventhook:To Reproduce
I've prepared CRA repo to show this bug.
One with latest version --> compare: failling-issue-v0.30.5
And one with version that introduced the problematic change: compare: failling-issue-v0.30.1
Expected behavior
Well, I should have no TS compiler errors following hook examples. I know, these are JS examples, but we should either provide working TS versions of examples, or fix the typings. I vote for the latter one.
Screenshots
N/A
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Additional context