From aa20c3569bdcb46a0fce5825b2d2e9128e029f19 Mon Sep 17 00:00:00 2001 From: Chuma McPhoy Date: Tue, 29 Oct 2024 10:32:47 +0100 Subject: [PATCH] fix(SW-667): add ErrorMessage --- components/TempDesignSystem/Form/Date/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/TempDesignSystem/Form/Date/index.tsx b/components/TempDesignSystem/Form/Date/index.tsx index 8f5e7347a..d697cff34 100644 --- a/components/TempDesignSystem/Form/Date/index.tsx +++ b/components/TempDesignSystem/Form/Date/index.tsx @@ -10,6 +10,7 @@ import { dt } from "@/lib/dt" import Select from "@/components/TempDesignSystem/Select" import { rangeArray } from "@/utils/rangeArray" +import ErrorMessage from "../ErrorMessage" import { DateName } from "./date" import styles from "./date.module.css" @@ -21,7 +22,7 @@ import type { DateProps } from "./date" export default function DateSelect({ name, registerOptions = {} }: DateProps) { const intl = useIntl() const currentValue = useWatch({ name }) - const { control, setValue, trigger } = useFormContext() + const { control, setValue, trigger, formState } = useFormContext() const { field } = useController({ control, name, @@ -204,6 +205,7 @@ export default function DateSelect({ name, registerOptions = {} }: DateProps) { }} + ) }