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
Hey there. Currently working on an MultiSelect component to use while TagField is in the works. One thing I am trying to do is validate my component as a field in a form. Generally I am trying to use useFormValidationState. What I have gets the job done for now, but I can't find much information about this and was hoping I could read up on it to get my validation to be a bit more robust (and be able to control things like when to re-validate).
Thanks so much!
Sample implementation:
// Set up form validation state with initial validationconstformValidationState=useFormValidationState({value: value||undefined,validationBehavior: 'native',
isRequired,});// Connect validation state to the inputuseFormValidation({validationBehavior: 'native'},formValidationState,inputRef);// above code can be implemented as such'aria-invalid': formValidationState.displayValidation.isInvalid,
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey there. Currently working on an MultiSelect component to use while TagField is in the works. One thing I am trying to do is validate my component as a field in a form. Generally I am trying to use
useFormValidationState
. What I have gets the job done for now, but I can't find much information about this and was hoping I could read up on it to get my validation to be a bit more robust (and be able to control things like when to re-validate).Thanks so much!
Sample implementation:
Beta Was this translation helpful? Give feedback.
All reactions