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

react-imask: IMaskMixin - Property 'inputRef' does not exist on type 'HTMLProps & { children?: ReactNode; }'. #608

Closed
Donorlin opened this issue Feb 3, 2022 · 4 comments

Comments

@Donorlin
Copy link

Donorlin commented Feb 3, 2022

Describe the bug
Simple typescript error Property 'inputRef' does not exist on type 'HTMLProps & { children?: ReactNode; }'. when using IMaskMixin

To Reproduce

IMaskMixin(({ inputRef, ...props }) => (
    <input
        {...props}
        ref={inputRef}
    />
));

I simplified the example with just a basic input. In my app i am using reactstrap's Input, which is nothing more than a simple wrapper over input so it does not matter.

Expected behavior
Since you are passing inputRef to ComposeComponent in mixin.ts#L239 its types should be corrected.
Right now ComposedComponents has props of type

export declare type ReactMaskedElement = React.HTMLProps<HTMLInputElement | HTMLTextAreaElement>;

which really does not have inputRef property.

Environment:

  • react 16.14.0
  • react-imask 6.4.0
  • typescript 4.5.5

If you want me to create a PR, feel free to tell me.

Thank you for your response.

@uNmAnNeR
Copy link
Owner

uNmAnNeR commented Feb 4, 2022

hey! thanks for reporting. Can you check #609?

@Donorlin
Copy link
Author

Donorlin commented Feb 4, 2022

Hey there! Thanks for the quick response and PR ! By the first look at your PR, it should do the trick. Thank you.

@uNmAnNeR
Copy link
Owner

uNmAnNeR commented Feb 6, 2022

@Donorlin Can you check on v6.4.1-alpha.0? thanks!

@Donorlin
Copy link
Author

Donorlin commented Feb 7, 2022

@uNmAnNeR Thanks for the alpha! I tested it, and the issue is fixed. I was able to smoothly use the mixin and created Input works as expected. Thanks !

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

No branches or pull requests

2 participants