Fix render-phase update in RenderSubFields

This commit is contained in:
2026-04-07 12:34:36 +01:00
parent 52071058d6
commit 503a0b5b9a
2 changed files with 32 additions and 2 deletions
@@ -1,4 +1,4 @@
import React from "react";
import React, { useEffect } from "react";
import { Field } from "redux-form";
import useTranslation from "next-translate/useTranslation";
import { RenderTextfield } from "./renderTextfield";
@@ -45,7 +45,11 @@ export const RenderSubFields = ({
return errors;
};
fields.length == 0 && fields.push({});
useEffect(() => {
if (fields.length === 0) {
fields.push({});
}
}, [fields, fields.length]);
return (
<ul className="subFieldList">