Skip to content

Commit de7116a

Browse files
author
remonke
authored
docs: change deprecated valibot withDefault to optional (#4728)
1 parent 2a0881f commit de7116a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/src/pages/guide/composition-api/typed-schema.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,15 +331,15 @@ You can also define default values on your schema directly and it will be picked
331331

332332
```ts
333333
import { useForm } from 'vee-validate';
334-
import { object, string, withDefault, minLength } from 'valibot';
334+
import { object, string, optional, minLength } from 'valibot';
335335
import { toTypedSchema } from '@vee-validate/valibot';
336336

337337
const { values, handleSubmit } = useForm({
338338
validationSchema: toTypedSchema(
339339
object({
340-
email: withDefault(string([minLength(1, 'required')]), '[email protected]'),
341-
password: withDefault(string([minLength(1, 'required')]), ''),
342-
name: withDefault(string(), ''),
340+
email: optional(string([minLength(1, 'required')]), '[email protected]'),
341+
password: optional(string([minLength(1, 'required')]), ''),
342+
name: optional(string(), ''),
343343
}),
344344
),
345345
});

0 commit comments

Comments
 (0)