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
I'm using valibot with react-hook-form, and I need one of my properties to be required but with a default value of null. When the form is submitted and the value is still null, it should not validate.
So far, I've managed this by creating a derived type from the output schema. However, I'm wondering if there's a more efficient way to handle this scenario?
I've added a simplified example of my scenario. The role selection isn't a typical input (here it's a clickable div, in my actual scenario it's a custom component).
Hi! 馃憢
I'm using
valibot
withreact-hook-form
, and I need one of my properties to be required but with a default value of null. When the form is submitted and the value is still null, it should not validate.So far, I've managed this by creating a derived type from the output schema. However, I'm wondering if there's a more efficient way to handle this scenario?
I've added a simplified example of my scenario. The role selection isn't a typical input (here it's a clickable div, in my actual scenario it's a custom component).
Thank you!
The text was updated successfully, but these errors were encountered: