Fix render-phase dispatch in FieldArrayForm
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user