GoncharukOrg / react-input

100 stars 7 forks source link

Error using custom component with required props #15

Closed dfontalv20 closed 7 months ago

dfontalv20 commented 8 months ago

When i try to use the InputMask component with a custom input, i have this error when this custom component has required props image

I think that a possible fix could be adding generic type to this React.ComponentType. Note the CP (Component Props) generic image

With this, the label prop is succesfully required in the InputMask component image

And if I add a value for this prop, the error dissapears image

GoncharukBro commented 8 months ago

Could you please provide the complete code that reproduces the error? Some of the information is hidden on the screenshots.

dfontalv20 commented 8 months ago

Here is a codesandbox: https://codesandbox.io/p/sandbox/priceless-dew-ty9662?file=%2Fsrc%2FApp.tsx%3A7%2C10

image

matrixmandeep commented 8 months ago

I'm also getting the same issue.

GoncharukBro commented 7 months ago

Thanks for opening the topic, please update the package to the latest version, which solves this problem:

npm i @react-input/mask@latest