b-gran/object-editor-react

Arrays of types other than Object do not work well

Closed this issue · 0 comments

Desired:
const schema = { identifier: Schema.SchemaTypes.number(), notes: Schema.SchemaTypes.string(), myArray: Schema.SchemaTypes.arrayOf(Schema.SchemaTypes.string())(), };
What goes wrong? The ElementRow does not show any input elements other than add/trash.

Contrast:
const schema = { identifier: Schema.SchemaTypes.number(), notes: Schema.SchemaTypes.string(), myArray: Schema.SchemaTypes.arrayOf({workaround: Schema.SchemaTypes.string()})(), };
Why does this work? props.type is used in ElementRow as _.map(Object.keys(props.type), ...). This does not work well when props.type is a function with no keys