mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-08 06:28:37 +00:00
fix(field): return null when errors are empty (#8419)
Co-authored-by: shadcn <m@shadcn.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -196,12 +196,12 @@ function FieldError({
|
||||
return children
|
||||
}
|
||||
|
||||
if (!errors) {
|
||||
if (!errors?.length) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (errors?.length === 1 && errors[0]?.message) {
|
||||
return errors[0].message
|
||||
if (errors?.length == 1) {
|
||||
return errors[0]?.message
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user