-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Check for type of array in default #1300
Comments
And there's a related issue, where a customer did not enter |
Is this related to #1238 ? I'm currently also running into an issue where we define null as default value which causes a render issue. |
I dont think it's related to that, this refers to when an array type has a default value of |
This issue might be fixed by #2154 but not sure -- need to check |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please leave a comment if this is still an issue for you. Thank you. |
Prerequisites
Description
When the
default
of an array type isnull
it causes an unrecoverable error:https://mozilla-services.github.io/react-jsonschema-form/#eyJmb3JtRGF0YSI6e30sInNjaGVtYSI6eyJ0aXRsZSI6IkEgcmVnaXN0cmF0aW9uIGZvcm0iLCJkZXNjcmlwdGlvbiI6IkEgc2ltcGxlIGZvcm0gZXhhbXBsZS4iLCJ0eXBlIjoib2JqZWN0IiwicHJvcGVydGllcyI6eyJhcnJheSI6eyJ0eXBlIjoiYXJyYXkiLCJkZWZhdWx0IjpudWxsLCJpdGVtcyI6eyJ0eXBlIjoic3RyaW5nIn19fX0sInVpU2NoZW1hIjp7fX0=
Steps to Reproduce
Expected behavior
Maybe disregard the default value if
!Array.isArray(formData)
?https://github.com/mozilla-services/react-jsonschema-form/blob/cc7e1b4f29ef5d18eb2c595daa186131426e0d49/src/components/fields/ArrayField.js#L296
Actual behavior
Unrecoverable error
Version
Latest on playground.
The text was updated successfully, but these errors were encountered: