Clean dead code in FieldArrayForm slice

This commit is contained in:
2026-04-07 14:27:31 +01:00
parent dcdec08f6d
commit 5e992507de
2 changed files with 29 additions and 9 deletions
-9
View File
@@ -1579,13 +1579,10 @@ const RenderFileUpload = (field) => {
export const FieldArrayForm = (props) => { export const FieldArrayForm = (props) => {
const { const {
name, name,
label,
validation,
form, form,
formProps, formProps,
parentFieldShowOnValue, parentFieldShowOnValue,
parentField, parentField,
maxFieldLength,
maxSubField maxSubField
} = props; } = props;
@@ -1599,18 +1596,12 @@ export const FieldArrayForm = (props) => {
formProps[form].values[parentField].toString() formProps[form].values[parentField].toString()
) > -1; ) > -1;
(showIfHasParentShowValue == parentField) != false &&
showIfHasParentShowValue;
useEffect(() => { useEffect(() => {
if (!showIfHasParentShowValue) { if (!showIfHasParentShowValue) {
dispatch(change("appealForm", name, null)); dispatch(change("appealForm", name, null));
} }
}, [dispatch, name, showIfHasParentShowValue]); }, [dispatch, name, showIfHasParentShowValue]);
parentFieldShowOnValue;
const { handleSubmit, pristine, reset, submitting } = props;
return ( return (
<> <>
{" "} {" "}
+29
View File
@@ -3499,3 +3499,32 @@ Validation:
Follow-ups: Follow-ups:
- Continue avoiding dispatch/state mutations inside render for field visibility toggles. - Continue avoiding dispatch/state mutations inside render for field visibility toggles.
---
### CL-098: 22500 `FieldArrayForm` bounded dead-code cleanup
date: 2026-04-07
author: Cline
scope: `components/elements/index.js`
type: change
rationale: Continue bounded Phase 2 cleanup with a lowest-risk slice by removing unused locals/destructured props in `FieldArrayForm`.
impact: No intended behavior change; purely removes unused values left from legacy implementation.
status: completed
Summary:
- Removed unused destructured props from `FieldArrayForm`: `label`, `validation`, `maxFieldLength`.
- Removed no-op/dead lines in `FieldArrayForm`:
- redundant boolean expression line
- unused `parentFieldShowOnValue;` expression
- unused `handleSubmit/pristine/reset/submitting` destructure
- Kept visibility logic, effect-driven clearing behavior, and `FieldArray` rendering path unchanged.
Validation:
- `npx eslint components/elements/index.js` -> pass
Follow-ups:
- Continue Phase 2 with one bounded slice at a time; next low-risk target can be similar dead-code/no-op cleanup in another isolated renderer block.