Skip to content

Releases: react-hook-form/resolvers

v2.9.3

24 Jun 23:38
52a6e07

Choose a tag to compare

2.9.3 (2022-06-24)

Breaking Change

  • compile error with UnpackNestedValue

BREAKING CHANGE: This change will update package dependency with react-hook-form to 7.33.0 above (52a6e07)

v2.9.2

23 Jun 22:16
7951951

Choose a tag to compare

2.9.2 (2022-06-23)

Bug Fixes

  • exchange fp-ts/Either over fp-ts/lib/Either (#419) (7951951)

v2.9.1

10 Jun 07:56
115db62

Choose a tag to compare

2.9.1 (2022-06-10)

Bug Fixes

  • ajv resolver to work with unlimited layers of nesting (#412) (692fe65)

v2.9.0

03 Jun 08:33
0cad904

Choose a tag to compare

2.9.0 (2022-06-03)

Features

import { useForm } from 'react-hook-form';
import { ajvResolver } from '@hookform/resolvers/ajv';

// must use `minLength: 1` to implement required field
const schema = {
  type: 'object',
  properties: {
    username: {
      type: 'string',
      minLength: 1,
      errorMessage: { minLength: 'username field is required' },
    },
    password: {
      type: 'string',
      minLength: 1,
      errorMessage: { minLength: 'password field is required' },
    },
  },
  required: ['username', 'password'],
  additionalProperties: false,
};

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

  return (
    <form onSubmit={handleSubmit((data) => console.log(data))}>
      <input {...register('username')} />
      {errors.username && <span>{errors.username.message}</span>}
      <input {...register('password')} />
      {errors.password && <span>{errors.password.message}</span>}
      <button type="submit">submit</button>
    </form>
  );
};

v2.8.10

17 May 07:15
c560af3

Choose a tag to compare

2.8.10 (2022-05-17)

Bug Fixes

  • update for other resolvers with new option (#404) (c560af3)

v2.8.9

15 May 08:59
259b4dc

Choose a tag to compare

2.8.9 (2022-05-15)

Bug Fixes

  • zod: add ability to skip zod's parsing (#401) (259b4dc)

v2.8.8

18 Jan 22:11
4ab4ec1

Choose a tag to compare

2.8.8 (2022-01-18)

Bug Fixes

v2.8.7

18 Jan 11:40
91f009b

Choose a tag to compare

2.8.7 (2022-01-18)

Bug Fixes

v2.8.6

18 Jan 09:01
83f3397

Choose a tag to compare

2.8.6 (2022-01-18)

Bug Fixes

v1.3.8

18 Jan 08:58
0f016f4

Choose a tag to compare

1.3.8 (2022-01-18)

Bug Fixes