You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My clumsy implementation to structure a FieldError with <p> along with guard for empty <p>'s.
exportfunctionOuiFieldError({ className, ...props}: FieldErrorProps){// FieldError seems to structure with a <span> and does not have elementType like Text.// Wrap with <p> to get closer to shadcn.// Guard with validation check to prevent empty <p>'s.// Reference: https://github.com/adobe/react-spectrum/issues/7525constvalidation=useContext(FieldErrorContext)if(!validation?.isInvalid){returnnull}return(<p><FieldError{...props}className={composeTailwindRenderProps(className,'text-[0.8rem] font-medium text-destructive')}/></p>)}
💁 Possible Solution
No response
🔦 Context
Use case for this ask is simpler implementation for composing rac with shadcn.
💻 Examples
No response
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered:
Provide a general summary of the feature here
Ask for
elementType
onFieldError
to structure aFieldError
with<p>
instead of<span>
, which seems to be the default.FieldError
seems to callText
internally. (https://github.com/adobe/react-spectrum/blob/main/packages/react-aria-components/src/FieldError.tsx). WhileText
seems to have anelementType
property,FieldError
does not.🤔 Expected Behavior?
Desired way to structure
FieldError
with<p>
.😯 Current Behavior
My clumsy implementation to structure a
FieldError
with<p>
along with guard for empty<p>
's.💁 Possible Solution
No response
🔦 Context
Use case for this ask is simpler implementation for composing rac with shadcn.
💻 Examples
No response
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: