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
React hook form is a popular form validation library that supports forms schema resolving by resolver API (https://github.com/react-hook-form/resolvers). Resolvers are already implemented for validators like yup, superstruct, etc which are natural competitors for this library.
For me, it seems like a common use-case to use schema definitions to validate forms. But to do that we need to first support reporting errors per object attribute (#13).
exportconstschemaResolver=(schema)=>{constvalidator=validate(schema);return(values)=>{try{return{values: validator(values),errors: {}};}catch(e){consterrors=/* get errors per schema attribute, each error should be a string */return{values: {},errors: errors};}};}
The text was updated successfully, but these errors were encountered:
React hook form is a popular form validation library that supports forms schema resolving by resolver API (https://github.com/react-hook-form/resolvers). Resolvers are already implemented for validators like yup, superstruct, etc which are natural competitors for this library.
For me, it seems like a common use-case to use schema definitions to validate forms. But to do that we need to first support reporting errors per object attribute (#13).
Resolver draft (trying to do it here):
The text was updated successfully, but these errors were encountered: