Skip to content

Commit

Permalink
update dependency array in useEffect to include form and showIPVRelat…
Browse files Browse the repository at this point in the history
…ed fields
  • Loading branch information
Omoshlawi committed Jan 22, 2025
1 parent d1fa4fc commit 67fecad
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { zodResolver } from '@hookform/resolvers/zod';
import { DefaultWorkspaceProps, useConfig, useSession } from '@openmrs/esm-framework';
import React, { useEffect, useMemo } from 'react';
import { Controller, FormProvider, SubmitHandler, useForm } from 'react-hook-form';
import { Controller, FormProvider, useForm } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
import { z } from 'zod';
import { ConfigObject } from '../config-schema';
Expand Down Expand Up @@ -119,7 +119,14 @@ const ContactListForm: React.FC<ContactListFormProps> = ({
if (!showIPVRelatedFields) {
form.setValue('ipvOutCome', undefined);
}
}, [observablePhysicalAssault, observableThreatened, observableSexualAssault, observableRelationship]);
}, [
observablePhysicalAssault,
observableThreatened,
observableSexualAssault,
observableRelationship,
form,
showIPVRelatedFields,
]);

return (
<FormProvider {...form}>
Expand Down

0 comments on commit 67fecad

Please sign in to comment.