Open
Description
Hey 👋
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 number
return `Please enter at least ${issue.requirement} characters`
default:
return issue.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