react-hook-form / resolvers

📋 Validation resolvers: Yup, Zod, Superstruct, Joi, Vest, Class Validator, io-ts, Nope, computed-types, typanion, Ajv, TypeBox, ArkType, Valibot, effect-ts and VineJS
https://react-hook-form.com/
MIT License
1.71k stars 155 forks source link

Valibot - Optional not found #645

Closed VigilioYonatan closed 9 months ago

VigilioYonatan commented 9 months ago

Describe the bug Not found optional form. show error

export const usersSchema = object({
    id: number(),
    name: string( [
        minLength(1),
        minLength(3),
        maxLength(20),
    ]),
    address: optional(
        string([minLength(10)]) // show error miLength when i submit form. should not show this error because is optional
    ))

Dependencies "@hookform/resolvers": "^3.3.2", "react-hook-form": "^7.48.2", "valibot": "^0.20.1",