react-spectrum
react-spectrum copied to clipboard
useSwitch does not expose validation API
Provide a general summary of the feature here
Unlike most other hooks, the useSwitch
hook does not provide isInvalid
and validationErrors
properties.
๐ค Expected Behavior?
useSwitch
exposes the standard validation API.
๐ฏ Current Behavior
useSwitch
does not expose the standard validation API.
๐ Possible Solution
useSwitch
exposes the standard validation API.
๐ฆ Context
It makes usage in forms difficult as it does not behave like other inputs.
๐ป Examples
const { inputProps, isInvalid, validationErrors } = useSwitch(props, state, ref as RefObject<HTMLInputElement>);
๐งข Your Company/Team
No response
๐ท Tracking Issue
No response