Controls: Don't render array when value is invalid

This commit is contained in:
Michael Shilman 2020-05-08 18:07:28 +08:00
parent 4c35a213b7
commit 7bf9709a0c

View File

@ -7,7 +7,7 @@ const parse = (value: string, separator: string): ArrayValue =>
!value || value.trim() === '' ? [] : value.split(separator);
const format = (value: ArrayValue, separator: string) => {
return value ? value.join(separator) : '';
return value && Array.isArray(value) ? value.join(separator) : '';
};
export type ArrayProps = ControlProps<ArrayValue> & ArrayConfig;