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

Discard invalid input props #1043

Open
2 tasks done
Avasam opened this issue Jun 23, 2021 · 0 comments
Open
2 tasks done

Discard invalid input props #1043

Avasam opened this issue Jun 23, 2021 · 0 comments

Comments

@Avasam
Copy link

Avasam commented Jun 23, 2021

(I was originally gonna post this on Material-UI, but realized this library is the cause)

Passing a custom component using MaskedInput to MUI's TextField's inputProps 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.

  • The issue is present in the latest release. (^5.4.7)
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

image

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

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant