Skip to content

Commit

Permalink
Merge pull request #172 from djnunez-aot/bug-fix
Browse files Browse the repository at this point in the history
Fix re render issue in CR
  • Loading branch information
jadmsaadaot authored Nov 19, 2024
2 parents 4002fc0 + e39f39f commit caeface
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default function FormFieldSection({
formData = defaultFormData,
}: FormFieldSectionProps) {
const [isHidden, setIsHidden] = useState(false);
const mergedFormData = { ...defaultFormData, ...formData };

return (
<>
Expand Down Expand Up @@ -90,8 +91,8 @@ export default function FormFieldSection({
<li>Nustuk</li>
<li>Langkuem</li>
<li>Miskuuck</li>
<When condition={Boolean(formData?.consultedParties)}>
{formData?.consultedParties?.map((field, index) => (
<When condition={Boolean(mergedFormData?.consultedParties)}>
{mergedFormData?.consultedParties?.map((field, index) => (
<li key={index}>{field.consultedParty}</li>
))}
</When>
Expand All @@ -110,7 +111,7 @@ export default function FormFieldSection({
Were all parties listed above consulted/engaged on the development
of this plan?
</Typography>
<RadioGroup value={formData.allPartiesConsulted}>
<RadioGroup value={mergedFormData.allPartiesConsulted}>
<YesNoRadioOptions disabled error={false} />
</RadioGroup>
</Grid>
Expand All @@ -119,7 +120,7 @@ export default function FormFieldSection({
Was the plan provided to all parties listed above for review and
comment during plan development?
</Typography>
<RadioGroup value={formData.planWasReviewed}>
<RadioGroup value={mergedFormData.planWasReviewed}>
<YesNoRadioOptions disabled error={false} />
</RadioGroup>
</Grid>
Expand All @@ -129,7 +130,9 @@ export default function FormFieldSection({
on how comments were fully and impartially considered and
addressed in the plan?
</Typography>
<RadioGroup value={formData.writtenExplanationsProvidedToParties}>
<RadioGroup
value={mergedFormData.writtenExplanationsProvidedToParties}
>
<YesNoRadioOptions disabled error={false} />
</RadioGroup>
</Grid>
Expand All @@ -140,7 +143,7 @@ export default function FormFieldSection({
addressed?
</Typography>
<RadioGroup
value={formData.writtenExplanationsProvidedToCommenters}
value={mergedFormData.writtenExplanationsProvidedToCommenters}
>
<YesNoRadioOptions disabled error={false} />
</RadioGroup>
Expand Down

0 comments on commit caeface

Please sign in to comment.