Skip to content

Commit

Permalink
fix: 'undefined' Error message in FormMessage Component
Browse files Browse the repository at this point in the history
  • Loading branch information
growupanand committed Jun 30, 2024
1 parent 06cc0cd commit 3713b47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/www/registry/default/ui/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const FormMessage = React.forwardRef<
React.HTMLAttributes<HTMLParagraphElement>
>(({ className, children, ...props }, ref) => {
const { error, formMessageId } = useFormField()
const body = error ? String(error?.message) : children
const body = error ? String(error?.message ?? error?.root?.message) : children

if (!body) {
return null
Expand Down

0 comments on commit 3713b47

Please sign in to comment.