Fix render-phase dispatch in FieldArrayForm

This commit is contained in:
2026-04-07 12:37:29 +01:00
parent 503a0b5b9a
commit dcdec08f6d
2 changed files with 32 additions and 2 deletions
+6 -2
View File
@@ -5,7 +5,7 @@ import _ from "lodash";
import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";
import React, { useMemo, useState } from "react";
import React, { useEffect, useMemo, useState } from "react";
import "react-datepicker/dist/react-datepicker.css";
import Dropzone from "react-dropzone";
import { Field, FieldArray, change } from "redux-form";
@@ -1602,7 +1602,11 @@ export const FieldArrayForm = (props) => {
(showIfHasParentShowValue == parentField) != false &&
showIfHasParentShowValue;
!showIfHasParentShowValue && dispatch(change("appealForm", name, null));
useEffect(() => {
if (!showIfHasParentShowValue) {
dispatch(change("appealForm", name, null));
}
}, [dispatch, name, showIfHasParentShowValue]);
parentFieldShowOnValue;
const { handleSubmit, pristine, reset, submitting } = props;