Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Apr 5, 2025

This PR contains the following updates:

Package Change Age Confidence
@hookform/resolvers (source) 1.3.8 -> 5.2.2 age confidence

Release Notes

react-hook-form/resolvers (@​hookform/resolvers)

v5.2.2

Compare Source

Bug Fixes

v5.2.1

Compare Source

Bug Fixes

v5.2.0

Compare Source

Features

v5.1.1

Compare Source

Bug Fixes

v5.1.0

Compare Source

Features
  • support Zod 4, Zod v4 mini, and retains compatibility with Zod v3. (#​777) (8d083bd)

v5.0.1

Compare Source

Bug Fixes
  • relax version constraint for react-hook-form 7.55.0 → ^7.55.0 (#​758) (6e88393)

v5.0.0

Compare Source

Features
BREAKING CHANGES
  • Requires react-hook-form@​7.55.0 or higher

Before
Prior to V5, some projects used manual types like

useForm<FormValues>();

After
With V5, the correct approach is:

useForm<Input, Context, Output>();
useForm<FormInputValues, Context, FormOutputValues>();

This update enables distinct outputs when utilizing features like transform from validation libraries.

ℹ️ The best approach is to let the types be inferred from your schema, rather than manually defining them.

v4.1.3

Compare Source

Bug Fixes
  • escape square brackets in field name regex pattern (#​752) (50dd4ad)

v4.1.2

Compare Source

Bug Fixes

v4.1.1

Compare Source

Bug Fixes
  • standard-schema: Propertly handle object path segments (#​746) (8ffada0)

v4.1.0

Compare Source

Features

v4.0.0

Compare Source

Bug Fixes
  • add support for names option (#​713) (985c48d)
  • arktypeResolver: resolve type error when schema is defined from an ArkType scope (#​732) (3233667)
  • handle raw: true option to pass form submission values correctly (#​733) (7807f95)
  • validateFieldsNatively: handle undefined object when reading 'refs' (#​734) (3da2054)
Features
  • ajv: Keep original validation type while using errorMessage (#​728) (5030a59)
  • effectResolver: returns either all errors or only the first one based on criteriaMode (#​737) (12d7d8e)
  • standard-schema: add standard-schema resolver (#​738) (b75a95a)
BREAKING CHANGES
  • ajv: The AJV Resolver now unwraps the errorMessage object to return the original error types. This update may introduce breaking changes to your projects.

v3.10.0

Compare Source

Features

v3.9.1

Compare Source

Bug Fixes

v3.9.0

Compare Source

Features
  • fluentvalidation-ts: add fluentvalidation-ts resolver (#​702) (5fc1e63)
import { useForm } from 'react-hook-form';
import { fluentValidationResolver } from '@&#8203;hookform/resolvers/fluentvalidation-ts';
import { Validator } from 'fluentvalidation-ts';

class FormDataValidator extends Validator<FormData> {
  constructor() {
    super();

    this.ruleFor('username')
      .notEmpty()
      .withMessage('username is a required field');
    this.ruleFor('password')
      .notEmpty()
      .withMessage('password is a required field');
  }
}

const App = () => {
  const { register, handleSubmit } = useForm({
    resolver: fluentValidationResolver(new FormDataValidator()),
  });

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

v3.8.0

Compare Source

Features

v3.7.0

Compare Source

Bug Fixes
  • zodResolver: cannot read properties of undefined (reading 'length') (a3e50c6)
  • chore: update valibot dependency to version >=0.33.0 (#​695)
Features
import { useForm } from 'react-hook-form';
import { vineResolver } from '@&#8203;hookform/resolvers/vine';
import vine from '@&#8203;vinejs/vine';

const schema = vine.compile(
  vine.object({
    username: vine.string().minLength(1),
    password: vine.string().minLength(1),
  }),
);

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

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

v3.6.0

Compare Source

Features

v3.5.0

Compare Source

Features

v3.4.2

Compare Source

Bug Fixes

v3.4.1

Compare Source

Bug Fixes

v3.4.0

Compare Source

Features

v3.3.4

Compare Source

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

v3.3.3

Compare Source

Bug Fixes

v3.3.2

Compare Source

Bug Fixes

v3.3.1

Compare Source

Bug Fixes

v3.3.0

Compare Source

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

Compare Source

Features

v3.1.1

Compare Source

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

Compare Source

Features

v3.0.1

Compare Source

Bug Fixes

v3.0.0

Compare Source

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
import { useForm } from 'react-hook-form';
import { typeboxResolver } from '@&#8203;hookform/resolvers/typebox';
import { Type } from '@&#8203;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

Compare Source

Bug Fixes

v2.9.10

Compare Source

Bug Fixes

v2.9.9

Compare Source

Bug Fixes

v2.9.8

Compare Source

Bug Fixes

v2.9.7

Compare Source

Bug Fixes

v2.9.6

Compare Source

Bug Fixes
  • yup: yup wrong import statement assuming default export (#​427) (928afae)

v2.9.5

Compare Source

Bug Fixes
  • renamed private packages to avoid ambiguity with existing official packages. (#​424) (18ae921)

v2.9.4

Compare Source

Bug Fixes

v2.9.3

Compare Source

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

Compare Source

Bug Fixes

v2.9.1

Compare Source

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

v2.9.0

Compare Source

Features
import { useForm } from 'react-hook-form';
import { ajvResolver } from '@&#8203;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

Compare Source

Bug Fixes

v2.8.9

Compare Source

Bug Fixes

v2.8.8

Compare Source

Bug Fixes

v2.8.7

Compare Source

Bug Fixes

v2.8.6

Compare Source

Bug Fixes

v2.8.5

Compare Source

Bug Fixes

v2.8.4

Compare Source

Bug Fixes

v2.8.3

Compare Source

Bug Fixes
  • zodResolver: no exported member ParseParamsNoData (#​264) (14683e5)

v2.8.2

Compare Source

Bug Fixes
  • TypeScript issues with the latest react-hook-form version (66182f8)

v2.8.1

Compare Source

Bug Fixes

v2.8.0

Compare Source

BREAKING CHANGES

v2.7.1

Compare Source

Performance Improvements

v2.7.0

Compare Source

Features
import { useForm } from 'react-hook-form';
import { typanionResolver } from '@&#8203;hookform/resolvers/typanion';
import * as t from 'typanion';

const isUser = t.isObject({
  username: t.applyCascade(t.isString(), [t.hasMinLength(1)]),
  age: t.applyCascade(t.isNumber(), [t.isInteger(), t.isInInclusiveRange(1, 100)]),
});

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

  return (
    <form onSubmit={handleSubmit((d) => console.log(d))}>
      <input {...register('name')} />
      {errors.name?.message && <p>{errors.name?.message}</p>}
      <input type="number" {...register('age')} />
      {errors.age?.message && <p>{errors.age?.message}</p>}
      <input type="submit" />
    </form>
  );
};

v2.6.1

Compare Source

Bug Fixes

v2.6.0

Compare Source

Features

v2.5.2

Compare Source

Bug Fixes

v2.5.1

Compare Source

Bug Fixes

v2.5.0

Compare Source

Features
import React from 'react';
import { useForm } from 'react-hook-form';
import { computedTypesResolver } from '@&#8203;hookform/resolvers/computed-types';
import Schema, { number, string } from 'computed-types';

const schema = Schema({
  username: string.min(1).error('username field is required'),
  password: string.min(1).error('password field is required'),
  password: number,
});

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

  return (
    <form onSubmit={handleSubmit((d) => console.log(d))}>
      <input {...register('name')} />
      {errors.name?.message && <p>{errors.name?.message}</p>}
      <input type="number" {...register('age', { valueAsNumber: true })} />
      {errors.age?.message && <p>{errors.age?.message}</p>}
      <input type="submit" />
    </form>
  );
};

export default App;

v2.4.0

Compare Source

Features
import React from 'react';
import { useForm } from 'react-hook-form';
import { nopeResolver } from '@&#8203;hookform/resolvers/nope';
import Nope from 'nope-validator';

const schema = Nope.object().shape({
  name: Nope.string().required(),
  age: Nope.number().required(),
});

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

  return (
    <form onSubmit={handleSubmit((d) => console.log(d))}>
      <input name="name" ref={register} />
      <input name="age" type="number" ref={register} />
      <input type="submit" />
    </form>
  );
};

export default App;

v2.3.2

Compare Source

Bug Fixes

v2.3.1

Compare Source

Bug Fixes

v2.3.0

Compare Source

Features
import React from 'react';
import { useForm } from 'react-hook-form';
import { ioTsResolver } from '@&#8203;hookform/resolvers/io-ts';
import t from 'io-ts';
// you don't have to use io-ts-types but it's very useful
import tt from 'io-ts-types';

const schema = t.type({
  username: t.string,
  age: tt.NumberFromString,
});

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

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

export default App;

v2.2.0

Compare Source

Features
Bug Fixes
Performance Improvements

v2.1.0

Compare Source

Features
import 'reflect-metadata';
import React from 'react';
import { useForm } from 'react-hook-form';
import { classValidatorResolver } from '@&#8203;hookform/resolvers/class-validator';
import { Length, Min, IsEmail } from 'class-validator';

class User {
  @&#8203;Length(2, 30)
  username: string;

  @&#8203;Min(18)
  age: number;

  @&#8203;IsEmail()
  email: string;
}

const App = () => {
  const {
    register,
    handleSubmit,
    formState: { errors },
  } = useForm<User>({ resolver:  classValidatorResolver(User) });

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

        <input type="text" {...register('email')} />
        {errors.email && <span>{errors.email.message}</span>}

        <input type="number" {...register('age', { valueAsNumber: true })} />
        {errors.age && <span>{errors.age.message}</span>}

        <input type="submit" value="Submit" />
      </form>
  );
};

export default App;

v2.0.1

Compare Source

Bug Fixes

v2.0.0

Compare Source

BREAKING CHANGES
  • Require react-hook-form >= 7
Features
Bug Fixes
Performance Improvements

V2 🚀 (#​108) (fe53179), closes #​108 #​97 #​114 #​116 #​115 #​117 #​123 #​125 #​124 #​126 #​127 #​128 #​129 #​131 #​130 #​132 #​134 #​136


Configuration

📅 Schedule: Branch creation - Only on Sunday and Saturday ( * * * * 0,6 ) (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies label Apr 5, 2025
@changeset-bot
Copy link

changeset-bot bot commented Apr 5, 2025

⚠️ No Changeset found

Latest commit: d14c4ac

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@renovate renovate bot force-pushed the renovate/hookform-resolvers-5.x branch from 665c922 to f090944 Compare August 10, 2025 07:58
@renovate renovate bot force-pushed the renovate/hookform-resolvers-5.x branch from f090944 to d14c4ac Compare September 21, 2025 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant