Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 26340b7

Browse files
committed
feat: from message
1 parent 50be7d2 commit 26340b7

File tree

3 files changed

+6
-36
lines changed

3 files changed

+6
-36
lines changed

.changeset/clean-bottles-relate.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@codefixlabs/ui': patch
3+
---
4+
5+
Form message

packages/ui/src/lib/form.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

packages/ui/src/react/form.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import type {
1212
import { Controller, FormProvider, useFormContext } from 'react-hook-form';
1313
import { twMerge } from 'tailwind-merge';
1414
import { Label } from '@/react/label';
15-
import { getErrorMessage } from '@/lib/form';
1615

1716
/* -----------------------------------------------------------------------------
1817
* Classes
@@ -220,7 +219,7 @@ export const FormMessage = forwardRef<
220219
React.ComponentPropsWithoutRef<'p'>
221220
>(({ children, className, ...props }, forwardedRef) => {
222221
const { error, formMessageId } = useFormField();
223-
const body = error ? getErrorMessage(error) : children;
222+
const body = error ? String(error.message) : children;
224223

225224
return (
226225
<>

0 commit comments

Comments
 (0)