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
Wondering if it's somehow possible to get the correct typescript type from issue.type
setGlobalMessage((issue)=>{switch(issue.type){case'min_length':
// issue is of type MinLengthIssue so the issue.requirement is a numberreturn`Please enter at least ${issue.requirement} characters`default:
returnissue.message}},'en')
In the example above the type of issue.requirement is unknown
I've tried this way but it didn't work out:
I've also tried to find something like InferIssue<'min_length'> to pass error type there and it also didn't work out 😅
valibot - 1.0.0-beta.9
The text was updated successfully, but these errors were encountered:
Hey 👋
Wondering if it's somehow possible to get the correct typescript type from
issue.type
In the example above the type of
issue.requirement
isunknown
I've tried this way but it didn't work out:
I've also tried to find something like
InferIssue<'min_length'>
to pass error type there and it also didn't work out 😅valibot - 1.0.0-beta.9
The text was updated successfully, but these errors were encountered: