diff --git a/src/utils/formUtil.ts b/src/utils/formUtil.ts index dbdd1b59..179b216e 100644 --- a/src/utils/formUtil.ts +++ b/src/utils/formUtil.ts @@ -336,8 +336,8 @@ export const eachComponentData = ( if (isComponentModelType(component, 'dataObject')) { // No need to bother processing all the children data if there is no data for this form or the reference value has not been loaded. const nestedFormValue: any = get(data, component.path); - const noReferenceAttached = nestedFormValue && nestedFormValue._id && isEmpty(nestedFormValue.data) && !has(nestedFormValue, 'form'); - const shouldProcessNestedFormData = nestedFormValue && nestedFormValue._id ? !noReferenceAttached : has(data, component.path); + const noReferenceAttached =nestedFormValue?._id && isEmpty(nestedFormValue.data) && !has(nestedFormValue, 'form'); + const shouldProcessNestedFormData = nestedFormValue?._id ? !noReferenceAttached : has(data, component.path); if (shouldProcessNestedFormData) { // For nested forms, we need to reset the "data" and "path" objects for all of the children components, and then re-establish the data when it is done. const childPath: string = componentDataPath(component, path, compPath);