fix: undefined error when creating new row without subFieldState present (#5502)

This commit is contained in:
Alessio Gravili
2024-03-27 17:13:06 -04:00
committed by GitHub
parent ee1e94be96
commit 3f4ab5f95e

View File

@@ -111,7 +111,7 @@ export function fieldReducer(state: FormState, action: FieldAction): FormState {
const withNewRow = [...(state[path]?.rows || [])]
const newRow: Row = {
id: (subFieldState?.id.value as string) || new ObjectId().toHexString(),
id: (subFieldState?.id?.value as string) || new ObjectId().toHexString(),
blockType: blockType || undefined,
collapsed: false,
}