Skip to content

Releases: react-hook-form/resolvers

v3.3.3

26 Dec 10:24
6f1b139
Compare
Choose a tag to compare

3.3.3 (2023-12-26)

Bug Fixes

v3.3.2

11 Oct 20:03
1baed6e
Compare
Choose a tag to compare

3.3.2 (2023-10-11)

Bug Fixes

v3.3.1

28 Aug 21:47
918d72f
Compare
Choose a tag to compare

3.3.1 (2023-08-28)

Bug Fixes

v3.3.0

22 Aug 12:36
94b2b84
Compare
Choose a tag to compare

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

06 Aug 10:27
2185330
Compare
Choose a tag to compare

3.2.0 (2023-08-06)

Features

v3.1.1

12 Jun 17:05
420e862
Compare
Choose a tag to compare

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

15 Apr 16:35
d2d6fec
Compare
Choose a tag to compare

3.1.0 (2023-04-15)

Features

v3.0.1

05 Apr 07:40
4a65f85
Compare
Choose a tag to compare

3.0.1 (2023-04-05)

Bug Fixes

v3.0.0

20 Mar 11:29
c433ba0
Compare
Choose a tag to compare

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

v2.9.11

08 Feb 08:17
fef6e4e
Compare
Choose a tag to compare

2.9.11 (2023-02-08)

Bug Fixes