Skip to content
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

useEventListener - unexpected token #157

Closed
Johannes5 opened this issue May 23, 2022 · 1 comment
Closed

useEventListener - unexpected token #157

Johannes5 opened this issue May 23, 2022 · 1 comment

Comments

@Johannes5
Copy link

I had this on the latest version:

./node_modules/usehooks-ts/dist/esm/useEventListener/useEventListener.js 10:34
[1] Module parse failed: Unexpected token (10:34)
[1] File was processed with these loaders:
[1]  * ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
[1] You may need an additional loader to handle the result of these loaders.
[1] |   }, [handler]);
[1] |   useEffect(() => {
[1] >     const targetElement = element?.current || window;
[1] | 
[1] |     if (!(targetElement && targetElement.addEventListener)) {
@juliencrn
Copy link
Owner

Hi @Johannes5, thanks for reporting the bug! I think it is related to #97, so you can use usehooks-ts@2.2.1, or you also can try our test v3 test-usehooks-ts where we have fixed this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants