diff --git a/packages/core/components/InputOrGroup/fields/ArrayField/index.tsx b/packages/core/components/InputOrGroup/fields/ArrayField/index.tsx index 2ae4798ed4..7fa76d45ed 100644 --- a/packages/core/components/InputOrGroup/fields/ArrayField/index.tsx +++ b/packages/core/components/InputOrGroup/fields/ArrayField/index.tsx @@ -30,7 +30,7 @@ export const ArrayField = ({ const { state, setUi } = useAppContext(); const arrayState: ArrayState = state.ui.arrayState[arrayFieldId] || { - items: Array.from(value).map((v) => ({ + items: Array.from(value || []).map((v) => ({ _arrayId: generateId("ArrayItem"), data: v, })), @@ -54,7 +54,7 @@ export const ArrayField = ({ // Create a mirror of value with IDs added for drag and drop useEffect(() => { - const newItems = Array.from(value).map((item, idx) => ({ + const newItems = Array.from(value || []).map((item, idx) => ({ _arrayId: arrayState.items[idx]?._arrayId || generateId("ArrayItem"), data: item, }));