-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Great library, much appreciated!
That said, I can't find any docs on the validate function except:
It doesn't say what to return to influence the error creation etc.
I asked copilot and it suggested:
rules={{
required: 'required',
validate: (value) => {
if (value.split(' ').length > 1) {
return 'no spaces allowed'
}
return true;
}
}}But it seems the return true may not be necessary? This seems to work fine?
rules={{
required: 'required',
validate: (value) => {
if (value.split(' ').length > 1)
return 'no spaces allowed'
}
}}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
