Resolvers Versions Save

📋 Validation resolvers: Yup, Zod, AJV, Joi, Superstruct, Vest, class-validator, io-ts, typanion, Ajv, TypeBox, Valibot and nope.

v3.3.4

4 months ago

3.3.4 (2024-01-04)

Bug Fixes

  • error handling for array errors with root error (1bfc6ab)

v3.3.3

4 months ago

3.3.3 (2023-12-26)

Bug Fixes

v3.3.2

7 months ago

3.3.2 (2023-10-11)

Bug Fixes

v3.3.1

8 months ago

3.3.1 (2023-08-28)

Bug Fixes

v3.3.0

8 months ago

3.3.0 (2023-08-22)

Bug Fixes

Features

  • add support for root errors for field array (#621) (5f1a622)
  • pass field names and a context as arguments to a Vest suite (#584) (3519701)
  • valibot: add more tests, support of criteriaMode and reduce size (#620) (a9d319d)

v3.2.0

9 months ago

3.2.0 (2023-08-06)

Features

v3.1.1

11 months ago

3.1.1 (2023-06-12)

BREAKING CHANGES

Bug Fixes

You don't need to explicitly provide the type when using the useForm function because it automatically infers the types from the Yup schema.

Before

const schema = Yup.shape({ name: string });

const { register } = useForm<{name: string}>({ resolver: yupResolver(schema) });

After

const schema = Yup.shape({ name: string });

const { register } = useForm({ resolver: yupResolver(schema) });

v3.1.0

1 year ago

3.1.0 (2023-04-15)

Features

v3.0.1

1 year ago

3.0.1 (2023-04-05)

Bug Fixes

v3.0.0

1 year ago

3.0.0 (2023-03-20)

BREAKING CHANGES

  • Yup resolver require Yup v1
  • rename rawValues option to raw
  • classValidationResolver: schema options now includes validator and transformer options
  • Please note that ajv and ajv-errors need to be installed separately, as they are not bundled with resolvers

Before:

schemaOptions?: ValidatorOptions,

After:

schemaOptions?: {
    validator?: ValidatorOptions;
    transformer?: ClassTransformOptions;
  }

Bug Fixes

Features

  • add option to keep raw values (f22d57c)
  • classValidationResolver: add transform and validator options (#524) (2749bd9)
  • yupResolver: add support Yup v1 (#520) (f3da212)
  • typeboxResolver: add TypeBox resolver (#526) (6a31c92)
import { useForm } from 'react-hook-form';
import { typeboxResolver } from '@hookform/resolvers/typebox';
import { Type } from '@sinclair/typebox';

const schema = Type.Object({
  username: Type.String({ minLength: 1 }),
  password: Type.String({ minLength: 1 }),
});

const App = () => {
  const { register, handleSubmit } = useForm({
    resolver: typeboxResolver(schema),
  });

  return (
    <form onSubmit={handleSubmit((d) => console.log(d))}>
      <input {...register('username')} />
      <input type="password" {...register('password')} />
      <input type="submit" />
    </form>
  );
};

Performance Improvements