Skip to content

Infinite re-rendering using disabled AutocompleteArrayInput in a ReferenceArrayInput #9714

@Nitix

Description

@Nitix

What you were expecting:

An stable page with a An AutocompleteArrayInput in an ReferenceArrayInput

What happened instead:

AutocompleteArrayInput keeps re-rendering

Steps to reproduce:

Add a disabled AutocompleteArrayInput in a ReferenceArrayInput

Related code:
https://stackblitz.com/edit/github-dmhu7h?file=src%2Fposts%2FPostEdit.tsx,package.json

Other information:

Environment

  • React-admin version: 4.6.12
  • Last version that did not exhibit the issue (if applicable):
  • React version: 18
  • Browser: Firefox 123
  • Stack trace (in case of a JS error):
Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.
AutocompleteInput@https://githubdmhu7h-miy1--8080--810981ba.local-corp.webcontainer.io/node_modules/.vite/deps/chunk-MFCMXL24.js?v=75640c3d:113882:21
AutocompleteArrayInput@https://githubdmhu7h-miy1--8080--810981ba.local-corp.webcontainer.io/node_modules/.vite/deps/chunk-MFCMXL24.js?v=75640c3d:114219:22
ChoicesContextProvider@https://githubdmhu7h-miy1--8080--810981ba.local-corp.webcontainer.io/node_modules/.vite/deps/chunk-MFCMXL24.js?v=75640c3d:15661:18
ResourceContextProvider@https://githubdmhu7h-miy1--8080--810981ba.local-corp.webcontainer.io/node_modules/.vite/deps/chunk-MFCMXL24.js?v=75640c3d:14501:18
ReferenceArrayInput@https://githubdmhu7h-miy1--8080--810981ba.local-corp.webcontainer.io/node_modules/.vite/deps/chunk-MFCMXL24.js?v=75640c3d:119879:14
div

My poor Firefox 🦊
image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions