nicolaslopezj/simple-react-form

[String] array field

JulianKingman opened this issue · 2 comments

I have a field defined in the schema as [String], and a field definition like so:

"photos": {type: [String], optional: true, srf: {type: PhotoInput}},

But that showed just the PhotoInput, not in array form. So I thought, let's try this:

"photos": {type: Array, optional: true, srf: {type: ArrayField}},
"photos.$": {type: String, srf: {type: PhotoInput}},

But that shows an empty array field, that is an array with no input field.

Does the array field only work for arrays of objects?

ArrayField is for arrays of object. You should create a field type for "photos".

I recommend you this examples:

Brilliant, thanks for the awesome support.