-
Notifications
You must be signed in to change notification settings - Fork 1.4k
useSwitch does not expose validation API #5548
Copy link
Copy link
Open
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels