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

Typescript error when importing elements #39

Closed
davidjentjens opened this issue Feb 12, 2021 · 2 comments
Closed

Typescript error when importing elements #39

davidjentjens opened this issue Feb 12, 2021 · 2 comments

Comments

@davidjentjens
Copy link

In many if not all declaration files, types are being imported like this:

import type { AnimationEffect } from './constants';
This is giving me the following typescript error:

TypeScript error in C:/Users/.../node_modules/react-useanimations/utils/getEvents.d.ts(1,13): '=' expected. TS1005

I don't know if this happens because of a version mismatch, but it generates errors in the building process. I fixed it locally by simply changing the syntax to the following.

import { AnimationEffect } from './constants';
This is a really cool package and I thought it might be good for me to let the author know of some issues I had with it.

davidjentjens added a commit to davidjentjens/react-useanimations that referenced this issue Feb 17, 2021
This is a fix for the issue useAnimations#39 that i opened recently. The changes made only change 'import type' to 'import'.
@marekfeikus
Copy link
Member

@davidjentjens Thanks for the report - it's possible that the bundler you're using has not yet supported import type for TS - eg. this nextJS discussion vercel/next.js#11909 (comment)

Please let me know if after some updates this is still an issue, thanks.

@marekfeikus
Copy link
Member

closing as it shouldn't be an issue.

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