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

Mui compatibility #327

Open
tomekxoxo opened this issue Jul 19, 2024 · 0 comments
Open

Mui compatibility #327

tomekxoxo opened this issue Jul 19, 2024 · 0 comments

Comments

@tomekxoxo
Copy link

tomekxoxo commented Jul 19, 2024

I am trying to pass Input mask into Autocomplete imported from MUI.
tested on 2. and 3. versions of the react-input-mask library.

<Autocomplete disablePortal id="combo-box-demo" options={[ { label: 'The Shawshank Redemption', year: 1994 }, { label: 'The Godfather', year: 1972 }, ]} sx={{ width: 300 }} renderInput={({ ...props }) => ( <InputMask mask="9999 / § 999 / 9" alwaysShowMask> {() => ( <TextField {...props} sx={{ flex: '0 0 160px', width: '360px' }} size="small" /> )} </InputMask> )} />

I Get error

react-input-mask: the following props should be passed to the react-input-mask's component and should not be altered in children's function: disabled.

If i alter the code

<Autocomplete disablePortal id="combo-box-demo" options={[ { label: 'The Shawshank Redemption', year: 1994 }, { label: 'The Godfather', year: 1972 }, ]} sx={{ width: 300 }} renderInput={({ disabled, ...props }) => ( <InputMask mask="9999 / § 999 / 9" alwaysShowMask disabled={disabled}> {() => ( <TextField {...props} sx={{ flex: '0 0 160px', width: '360px' }} size="small" /> )} </InputMask> )} />

I get another error

Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

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