Releases: mantinedev/mantine-form-zod-resolver
Releases · mantinedev/mantine-form-zod-resolver
1.3.0
1.2.0
Zod 4 support
This minor release provides support for zod 4.
To use the package with zod 4:
- Update
mantine-form-zod-resolver
to1.2.1
- Update zod to version
3.25.0
or later - Replace
zod
imports withzod/v4
- Replace
zodResolver
withzod4Resolver
in your code
Example with zod 4
const schema = z.object({
name: z.string().min(2, { message: 'Name should have at least 2 letters' }),
email: z.email({ message: 'Invalid email' }),
age: z.number().min(18, { message: 'You must be at least 18 to create an account' }),
});
const form = useForm({
initialValues: {
name: '',
email: '',
age: 16,
},
validate: zod4Resolver(schema),
})