Skip to content

Releases: react-hook-form/react-hook-form

Version 7.81.0

Choose a tag to compare

@bluebill1049 bluebill1049 released this 05 Jul 02:56

⚜️ feat: FieldArray component (#13394)

<FieldArray
  control={control}
  name="test"
  render={({ fields }) => null}
/>

🐞 fix #13538 useFieldArray min 1 item validation error changes its location in the errors object (#13539)
🐞 fix #13569 calling reset triggers subscribe with latest name instead of undefined (#13574)
🐞 fix(useController): reflect cleared parent object in controlled fields (#13550) (#13553)
🐞 fix(flatten): preserve Date values as leaf nodes (#13566)
🐛 fix(unset): guard against prototype keyword path traversal (#13559) (#13560)
🏸 improve setValue api with shrink value (#13576)
👝 close #13577 improve re-render with useFieldArray reset (#13578)
🐞 fix #13575 issue: clearErrors changes the name value from form.subscribe (#13579)

thanks to @DakshSinghDhami, @JSap0914, @tran-simon & @EduardF1

Version 7.80.0

Choose a tag to compare

@bluebill1049 bluebill1049 released this 20 Jun 01:11

🧄 feat: disable useFieldArray fields (#13535)

const { fields } = useFieldArray({ disabled: true });
fields[0].disabled; // contains disabled props

🛺 perf: make rhf more performant (#13524)
🐞 fix(deepEqual): empty array and empty plain object should not be equal (#13533)

thanks to @JSap0914

Version 7.79.0

Choose a tag to compare

@bluebill1049 bluebill1049 released this 13 Jun 04:24

🚷 feat: use field array disabled (#13520)

useFieldArray({ disabled, name: 'test' })

🐞 fix controller onChange promise (#13518)
🐞 fix: track visited pairs in deepEqual to avoid false positives with shared object references (#13515)
🐞 fix #12651 issue: field validation with shouldUseNativeValidation does not behave native like for radio groups (#13512)
🐞 fix #12754 createFormControl breaks with fast refresh in dev mode (#13511)
🐞 close #12709 #12750 StrictMode would remove field value & get mounted again (#13508)
🐞 fix #13505 issue: In v8 with React compiler, a change in formState errors does not cause child components to re-render (#13510)

thanks to @DucMinhNe & @louzhedong

Version 7.78.0

Choose a tag to compare

@bluebill1049 bluebill1049 released this 07 Jun 23:52

🦷 update type dirtyFields typing for field arrays with undefined entries (#13492)
🐞 fix: recover Controller fields after reset without rerender (RN issue #13455) (#13497)
🐞 fix useFormState().isDirty race with async resolver in onChange mode (#13495)
🐞 fix: use reactive values prop over defaultValues when shouldUnregister is true (#13485)
🐞 fix deepEqual for empty non-plain objects (#13493)

thanks to @cyphercodes

Version 7.77.0

Choose a tag to compare

@bluebill1049 bluebill1049 released this 31 May 11:05

🥡 feat: add resetDefaultValues API (#13427)

https://react-hook-form.com/docs/useform/resetdefaultvalues

const { resetDefaultValues } = useForm();

resetDefaultValues(currentValues);

🐚 harden get() against prototype-path traversal (proto / constructor / prototype) (#13479)
🐞 fix FieldArray errors overriding nested fields (#13476)
🐞 fix inconsistent reset({}) behavior requiring double-call to take effect (#13473)
🐞 fix: preserve values with shouldUnregister (#13464)
🐞 fix stale isDirty in subscribe payload after reset(..., { keepValues: true }) (#13461)
👝 save bundle size (#13468)

thanks to @puneetdixit200 & @dfedoryshchev

Version 7.76.1

Choose a tag to compare

@bluebill1049 bluebill1049 released this 23 May 06:56

🐞 fix: pass options parameter through setValues to enable validation (#13457)
🐞 fix(setValues): emit whole-form change without stale name/type (#13450)
🚗 perf(setValues): thread skipClone through setFieldValue (#13448)
🚗 perf(setValues): skip redundant per-field deep clones (#13445)
Revert "🐞 fix: treat NaN as empty when valueAsNumber is true in validateField (#13388)"

thanks to @philibea & @maxkostow

Version 8.0.0-beta.2

Version 8.0.0-beta.2 Pre-release
Pre-release

Choose a tag to compare

@bluebill1049 bluebill1049 released this 16 May 23:09

🦾 Syncs v8 beta with the latest master branch, bringing over recent v7 bug fixes, performance improvements, refactors, and DX updates.

Version v7.76.0

Choose a tag to compare

@bluebill1049 bluebill1049 released this 16 May 00:34

🪭 close #13141 improve isDirty sync with dirtyFields state (#13370)
🐞 fix isValidating reactivity when validatingFields is not subscribed (#13440)
🛺 test: fix duplicate-word typos in test descriptions (#13439)
🐞 fix #13436: errors state when using form level validation (#13437)
🐞 fix #13429 append({ obj: null }) is silently replaced by defaultValues after remove() (#13435)
🐞 fix native validation tooltip suppression caused by duplicate submit-error focus (#13432)
🐞 fix: propagate setValues updates to mounted Controller fields (#13431)
🐞 fix: rreserve reset values for conditionally mounted Controller fields with shouldUnregister
🐞 fix: useFieldArray remove leaves array with empty object when using values prop (#13422)
🐞 fix #13260: notify all matching field-array roots on nested setValue updates (#13420)
🐞 fix #13104: preserve nested resolver field-array errors in trigger() (#13419)
🐞 fix #13413: preserve formState.defaultValues when useFieldArray + watch are used together
📝 docs: fix JSDoc for IsNever, register, and getFieldState (#13410) (#13411)
🐞 fix(Watch): restore TypeScript 4 compatibility (#13409)

Big thanks to @dfedoryshchev for multiple fixes, and to @EduardF1, @in-ch and @johnstrand.

Version 7.75.0

Choose a tag to compare

@bluebill1049 bluebill1049 released this 02 May 01:11

🦧 feat: improve get dirty fields prune empty fields (#13363)

+ dirtyFields: { test: [{ data: false }] }
- dirtyFields: {} // removed the empty node with false value

🎹 typescript 6.0 (#13330)
🌡️ chore: minor improvement on setValue & reset (#13366)
🐞 fix #13403: include setValues in FormProvider context value (#13404)
🐞 fix: recompute isDirty after re-registering a previously unregistered field (#13399)
🐞 fix: preserve watch updates on field array unmount fixes #13375 (#13385)
🐞 fix: prevent useWatch re-render when unrelated field validation is … (#13398)

thanks to @dfedoryshchev, @cyky & @gkarabelos

Version 7.74.0

Choose a tag to compare

@bluebill1049 bluebill1049 released this 25 Apr 21:54

🪇 feat: setValues (#13201)

setValues((data) => {
  return {
    ...data,
    name: 'test'
  }
})

setValues(formValues);

🐞 fix: preserve previous field value when useController name changes (#13395)
🐞 fix: handle null parent when unregistering nested field (#13396)
🐞 fix: treat NaN as empty when valueAsNumber is true in validateField (#13388)
🪢 fix build to exclude test files (#13387)

thanks to @Yihao-G & @mixelburg