Skip to content

Releases: react-hook-form/resolvers

v2.0.0-beta.2

05 Jan 12:41

Choose a tag to compare

v2.0.0-beta.2 Pre-release
Pre-release

2.0.0-beta.2 (2021-01-05)

Features

  • improve modules support (507ee0d)

v2.0.0-beta.1

05 Jan 12:25

Choose a tag to compare

v2.0.0-beta.1 Pre-release
Pre-release

2.0.0-beta.1 (2021-01-05)

Features

BREAKING CHANGES

  • there will be some breaking changes in the next versions

v1.3.2

04 Jan 22:00
115f041

Choose a tag to compare

1.3.2 (2021-01-04)

Bug Fixes

Version 1.3.1

30 Dec 22:55
181271d

Choose a tag to compare

esm support to fix bundler incompatibility (#95)

Version 1.3.0

29 Dec 07:51

Choose a tag to compare

Support Yup ^0.32.0 (#92)

Version 1.2.0

14 Dec 22:22

Choose a tag to compare

vestResolver (#82)

import * as React from 'react';
import { useForm } from 'react-hook-form';
import { vestResolver } from '@hookform/resolvers/vest';
import vest, { test, enforce } from 'vest';

const validationSuite = vest.create((data = {}) => {
  test('username', 'Username is required', () => {
    enforce(data.username).isNotEmpty();
  });

  test('username', 'Must be longer than 3 chars', () => {
    enforce(data.username).longerThan(3);
  });

  test('password', 'Password is required', () => {
    enforce(data.password).isNotEmpty();
  });

  test('password', 'Password must be at least 5 chars', () => {
    enforce(data.password).longerThanOrEquals(5);
  });

  test('password', 'Password must contain a digit', () => {
    enforce(data.password).matches(/[0-9]/);
  });

  test('password', 'Password must contain a symbol', () => {
    enforce(data.password).matches(/[^A-Za-z0-9]/);
  });
});

const App = () => {
  const { register, handleSubmit, errors } = useForm({
    resolver: vestResolver(validationSuite),
  });

  return (
    <form onSubmit={handleSubmit((data) => console.log(data))}>
      <input type="text" name="username" ref={register} />
      <input type="text" name="password" ref={register} />
      <input type="submit" />
    </form>
  );
};

Version 1.1.2

09 Dec 08:09

Choose a tag to compare

fix: superstruct filename typo (#89)

Version 1.1.1

30 Nov 22:58

Choose a tag to compare

fix: IE11 build (#85)

Version 1.1.0

30 Nov 07:36
02814b0

Choose a tag to compare

Update Superstruct version (#83)

Version 1.0.1

06 Nov 22:39

Choose a tag to compare

  • build: add TS declaration file to ie11 build (#72)
  • Use right version of react-hook-form for ie11 bundle (#68)