Skip to content

Typing issues in 3.0+  #34

@jaroslawkyc

Description

@jaroslawkyc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions