You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ArrayInput component has a breaking different behaviour in the dev environment and when you actually build the project; an empty ArrayInput (that has not been interacted with) will:
Return an empty array in dev
Return undefined in the build
Note: interacting with it in the build version (adding an entry) but still leaving it empty (removing all entries before submitting) will return an empty array too, as expected.
What you were expecting:
Both environments should behave the same way, preferably returning an empty array in both.
What happened instead:
Inside the build, a not-interacted ArrayInput returns undefined.
Steps to reproduce:
Have a Create Page with an ArrayInput
Create a new record with said page, without adding any entries to the ArrayInput
This was bootstrapped with react-admin, and replaced the dataProvider with a very simple one that will just alert information about the type received from the ArrayInput, alongside a CreatePage that features an ArrayInput.
The dev server can be started with yarn dev and the build created with yarn build, as per usual.
Other information:
Environment
React-admin version: 4.16.7 (the minimal repo uses the version included in the bootstrap, but I have verified the issue with this one too)
React version: 18.2.0
Browser: Chrome
The text was updated successfully, but these errors were encountered:
I belive (could be wrong) that the only change Strict Mode makes that actually could change behaviour is that it will run useEffect twice for components... maybe there's something that doesn't get initialized correctly the first time, but on the second run it finally does?
The
ArrayInput
component has a breaking different behaviour in the dev environment and when you actually build the project; an emptyArrayInput
(that has not been interacted with) will:undefined
in the buildNote: interacting with it in the build version (adding an entry) but still leaving it empty (removing all entries before submitting) will return an empty array too, as expected.
What you were expecting:
Both environments should behave the same way, preferably returning an empty array in both.
What happened instead:
Inside the build, a not-interacted
ArrayInput
returnsundefined
.Steps to reproduce:
ArrayInput
ArrayInput
Related code:
Since this issue requires a build, instead of a sandbox I provide a minimal reproduction example repo: https://github.com/PedroPerpetua/ra-array-input-bug
This was bootstrapped with react-admin, and replaced the dataProvider with a very simple one that will just
alert
information about the type received from the ArrayInput, alongside a CreatePage that features an ArrayInput.The dev server can be started with
yarn dev
and the build created withyarn build
, as per usual.Other information:
Environment
The text was updated successfully, but these errors were encountered: