Skip to content

Commit 6a54b6a

Browse files
committed
fix: update note on joi
1 parent 18a7a69 commit 6a54b6a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/src/pages/guide/migration.mdx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,16 @@ const { value, errorMessage } = useForm({ validationSchema: schema });
8888

8989
### Joi
9090

91-
Joi is no longer supported in vee-validate v5, you can create a custom adapter using the `@standard-schema/spec` for it or ask their maintainers to add support for standard schema.
91+
vee-validate is compatible with Joi v18.0.0 and above.
92+
93+
```ts
94+
import * as Joi from 'joi';
95+
96+
// v4
97+
const schema = toTypedSchema(Joi.object({ email: Joi.string().email() }));
98+
99+
// v5 - remove the call to `toTypedSchema`
100+
const schema = Joi.object({ email: Joi.string().email() });
101+
102+
const { value, errorMessage } = useForm({ validationSchema: schema });
103+
```

0 commit comments

Comments
 (0)