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

react-admin TextInput multiline without fixed width or fullWidth causes Too many re-renders. The layout is unstable #7780

Closed
rcfrias opened this issue Jun 2, 2022 · 4 comments

Comments

@rcfrias
Copy link

rcfrias commented Jun 2, 2022

What you were expecting:
Follow and implement Tutorial instructions without any console errors in the DevTools console.

What happened instead:
Frontend renders fine, but console is flooded with errors: "Too many re-renders. The layout is unstable"

Steps to reproduce:
Follow the tutorial, I've isolated the problem. The bug happens only when this line is present:

Related code:

<TextInput multiline source='body' /> // <- multiple errors
// changing to: 
<TextInput fullWidth multiline source='body' /> // no errors

The exact console error is:
MUI: Too many re-renders. The layout is unstable.TextareaAutosize limits the number of renders to prevent an infinite loop.

@antoinefricker
Copy link
Contributor

Hello and thanks for your report.

I have not been able to reproduce this bug using the source code provided with the tutorial.
Here is a codesandbox using unmodified source from the repo: https://codesandbox.io/s/github/marmelab/react-admin/tree/master/examples/tutorial

Am I missing something?

@davidhenley
Copy link
Contributor

davidhenley commented Jun 13, 2022

@septentrion-730n @rcfrias I was able to reproduce in 4.1.3:

<TextInput source="notes" multiline />

@rcfrias It still errors with fullWidth once you start deleting lines. It's a problem with the height autosizing.

It even errors with rows prop set as well, once you start deleting lines when you get to less lines than the rows number

Screen Shot 2022-06-13 at 4 03 59 PM

@davidhenley
Copy link
Contributor

davidhenley commented Jun 23, 2022

Here is the fix @septentrion-730n mui/material-ui#33253

@fzaninotto
Copy link
Member

I understand this was an MUI bug that was fixed upstream, so we can close the issue.

Feel free to comment if this is not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants