-
Notifications
You must be signed in to change notification settings - Fork 829
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
Discard invalid input props #1043
Comments
Avasam
added a commit
to Avasam/speedrun.com_global_scoreboard_webapp
that referenced
this issue
Jun 24, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(I was originally gonna post this on Material-UI, but realized this library is the cause)
Passing a custom component using
MaskedInput
to MUI'sTextField
'sinputProps
property seems to be passed all the way to the actual<input>
element, which causes this error to appear in the console:index.js:1 Warning: React does not recognize the `inputComponent` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `inputcomponent` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
Current Behavior 😯
Expected Behavior 🤔
No errors as-is with Material-UI/text-mask, without having to resort to a workarounds such as
{ inputProps, ...props }: CustomProps
.inputProps
is specifically an issue here as it's used with MUI, but I believe the true solution is to discard all invalid input properties.Steps to Reproduce 🕹
Use a MaskedInput with some inputProps
https://codesandbox.io/s/delicate-meadow-2j75c
https://github.com/Avasam/speedrun.com_global_scoreboard_webapp/blob/develop/tournament-scheduler/src/Components/ScheduleManagement/ScheduleWizard/NonZeroNumberInput.tsx
The text was updated successfully, but these errors were encountered: