yarn react-hook-form 7.93.0
Version 7.93.0

one hour ago

๐Ÿš€ New Feature: Built-in DevTools

Introducing a new lightweight, built-in DevTool for inspecting and debugging your forms, without installing an additional package. (#13909)

DevTools are available through a separate entry point, keeping them out of your core bundle when unused.

import { useForm } from 'react-hook-form';
import { DevTool } from 'react-hook-form/devtools';

function App() {
  const { register, control } = useForm();

  return (
    <>
      <input {...register('firstName')} />
      <DevTool control={control} />
    </>
  );
}

๐Ÿž Fixes

  • Fix register not recording disabled state on first registration (#14029)
  • Fix handleSubmit not stopping at the first invalid nested field with native validation (#14026)
  • Fix native validation reporting on disabled group inputs (#14031)
  • Fix useForm not preserving options from an existing formControl (#14046)
  • Fix useWatch unnecessarily recomputing values during cleanup (#14045)
  • Fix isValid not stopping at the first invalid nested field (#14043)
  • Fix pending asynchronous validation overwriting reset state (#14042)
  • Fix reset failing when a form control is named reset (#14037)
  • Fix stale validation results after nested value changes (#14053)
  • Fix useFieldArray displaying resolver errors for untouched rows in onTouched mode (#14054)
  • Fix trigger not awaiting form-level validation before validating named fields (#14055)
  • Fix Controller required validation passing for empty file inputs (#14061)
  • Fix register retaining removed validation dependencies (#14062)
  • Fix resolver-based isValid checks triggering native validation messages (#14064)
  • Fix useFieldArray losing per-row dirty state when validation rules are provided (#14065)
  • Fix reset and resetField retaining native validation messages (#14067)
  • Fix setValue not preserving registered object fields when setting parent values (#14068)
  • Fix clearErrors retaining native validation messages (#14071)
  • Fix getValues filtering values when dirtyFields or touchedFields is false (#14083)
  • Fix object-valued registered fields not being tracked as a single dirty field (#14074)
  • Fix setValue not clearing multiple select options for nullish values (#14075)
  • Fix reset not preserving mounted form state with keepValues (#14087)
  • Fix reset not applying values with keepDefaultValues and shouldUnregister (#14086)
  • Fix useController dirty state becoming inconsistent when a shouldUnregister field remounts (#14081)
  • Fix resetField not discarding pending asynchronous validation results (#14091)
  • Fix useFieldArray losing remaining row registrations after removal when validation rules are provided (#14094)
  • Fix field array dirty state when updating values from a parent field (#14095)

โšก Performance Improvements

  • Optimize cloneObject by iterating over own object keys (#14051)

๐Ÿงน Refactors

  • Remove redundant promise validation guard (#14057)
  • Consolidate FileList checks across internal utilities (#14063)

๐Ÿงช Tests

  • Expand regression coverage for asynchronous validation, native validation, field arrays, dirty state, and reset behaviour
  • Add unit and end-to-end tests for the new DevTools
  • Fix Jest coverage configuration (#14058)

๐Ÿ“ฆ Dependencies

  • Bump terser from 5.48.0 to 5.51.4 (#14093)
  • Bump cross-spawn from 7.0.6 to 7.1.2 (#14092)

โค๏ธ Thank You

Thanks to @Sophran-fbj, @dfedoryshchev, @yuxino, @ninglinLiu, @h00ns, @itisrmk, @charan-rathore, @CharoenwitKunna, @wozhenbang2004, @g4lb, @candymask0712, @oyobbeb, @sagarrsharmaa, @phatstraws, @Chen1098, @turalbabayev, @ErickGCA, @smcqueen-sudo and @bluebill1049 for their contributions! ๐ŸŽ‰

Special thanks to the Acquisity and Limetec Biotechnologies teams for their incredible support! โค๏ธ

Don't miss a new react-hook-form release

NewReleases is sending notifications on new releases.