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

Typing issues in 3.0+ #34

Open
jaroslawkyc opened this issue Jul 8, 2022 · 0 comments
Open

Typing issues in 3.0+ #34

jaroslawkyc opened this issue Jul 8, 2022 · 0 comments

Comments

@jaroslawkyc
Copy link

Hello, there seems to be some typing issues in versions 3.0 and upwards. When I try to use your component through ref I get this
'AnnounceKit' refers to a value, but is being used as a type here. Did you mean 'typeof AnnounceKit'?

After changing it to const ref = React.createRef<typeof AnnounceKit>(); it seems that all the typing which were available in versions up to version 3 is gone Property 'open' does not exist on type 'ForwardRefExoticComponent<AnnounceKitProps & RefAttributes<unknown>>'.ts(2339).

It seems to me that this part in your declaration file declare const _default: React.ForwardRefExoticComponent<AnnounceKitProps & React.RefAttributes<unknown>>; export default _default; seems to be the problem. Shouldn't React.RefAttributes<unknown> have something else casted other than unknown or am I just using your library wrong? I've followed your readme available in this repo.

Thank you for your help.

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

1 participant