-
Notifications
You must be signed in to change notification settings - Fork 417
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
customInputProps with Typescript #295
Comments
I forked it and the following works for me |
We have the same use case as @cescoferraro, a Our current workaround is: const CustomInput = ({ customInputProps, ...inputProps }) => { ... }
...
// @ts-ignore
<NumberFormat
value={value}
customInput={CustomInput}
customInputProps={someProps}
/> |
@s-yadav @cescoferraro @Robfz I've fixed typings in #330 |
In the meantime you can install |
I don't think we need customInputProps to solve the typing issue, as we forward all the props to custom input. I liked the @Yankovsky solution to accept any other props. It does allow accepting any random prop, but I think for DX that tradeoff should be ok. I have merged and released @Yankovsky PR on v4.1.0 |
I am using material-ui TextField input as a customInput. Problem is that I need to pass it some other props like disableUnderline, but this prop does not exist on NumberFormat and it makes the typescript compiles scream, although it works!
The text was updated successfully, but these errors were encountered: