formik-validator-zod
Version:
Helper to simplify validating Formik values with Zod
11 lines (10 loc) • 375 B
TypeScript
import type { ZodSchema, ParseParams } from 'zod';
/**
* Allows you to easily use Zod schemas with the <Formik /> component `validate`
* prop.
*
* ```js
* <Formik {...} validate={withZodSchema(yourSchema)}>
* ```
*/
export declare const withZodSchema: <T>(schema: ZodSchema<T, import("zod").ZodTypeDef, T>, params?: Partial<ParseParams>) => (values: T) => Partial<T>;