@hookform/resolvers
Version:
React Hook Form validation resolvers: Yup, Joi, Superstruct, Zod, Vest, Class Validator, io-ts, Nope, computed-types, TypeBox, arktype, Typanion, Effect-TS and VineJS
20 lines (19 loc) • 722 B
TypeScript
import type { Resolver } from './types';
/**
* Creates a resolver for react-hook-form using Nope schema validation
* @param {NopeSchema} schema - The Nope schema to validate against
* @param {NopeSchemaOptions} [schemaOptions] - Optional Nope validation options
* @param {Object} resolverOptions - Additional resolver configuration
* @param {string} [resolverOptions.mode='async'] - Validation mode
* @returns {Resolver<NopeSchema>} A resolver function compatible with react-hook-form
* @example
* const schema = nope.object({
* name: nope.string().required(),
* age: nope.number().required()
* });
*
* useForm({
* resolver: nopeResolver(schema)
* });
*/
export declare const nopeResolver: Resolver;