Skip to content

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

Version 7.46.0-next.0

13 Aug 02:43
Compare
Choose a tag to compare
Version 7.46.0-next.0 Pre-release
Pre-release

disabled prop

  • new disabled props for useForm
  • allow user to disable the entire form with all associated inputs
useForm({
  disabled: true
})

const App = () => {
  const [disabled, setDisabled] = useState(false);
  const { register, handleSubmit, control } = useForm({
    disabled,
  });

  return (
    <form
      onSubmit={handleSubmit(async () => {
        setDisabled(true);
        await sleep(100);
        setDisabled(false);
      })}
    >
      <input
        type={'checkbox'}
        {...register('checkbox')}
        data-testid={'checkbox'}
      />
      <input type={'radio'} {...register('radio')} data-testid={'radio'} />
      <input type={'range'} {...register('range')} data-testid={'range'} />
      <select {...register('select')} data-testid={'select'} />
      <textarea {...register('textarea')} data-testid={'textarea'} />

      <Controller control={control} render={({ field }) => <input disabled={field.disabled}  />} name="test" />

      <button>Submit</button>
    </form>
  );
}

Version 7.45.4

05 Aug 13:36
Compare
Choose a tag to compare

🐞 fix #10767 dep issue with replayio (#10768)
🐞 fix #10762 async submit with Form component (#10766)
🫖 add test case for issue #10744 to avoid future regressions (#10759)

thanks to @eg-bernardo

Version 7.45.3

04 Aug 22:22
Compare
Choose a tag to compare

📼 add Replay Test Suites (#10681)
Revert "🧑‍🎓 close #10585 update controller value on each render (#10586)"
🐞 close #10682 make sure action flag gets reset after useEffect (#10732)

thanks to @jasonLaster

Version 7.45.2

17 Jul 13:42
Compare
Choose a tag to compare

🧾 fix(types): async defaultValues await promise value (#10637)
🥲 revert strict type check on Controller onChange (#10609)
📖 docs(changelog 7.45.0): typo and format (#10624)
📖 fix:test-spelling-error (#10629)

thanks to @anton-g, @milhamm, @moshfeu & @OlliePrentice

Version 7.45.1

28 Jun 11:05
Compare
Choose a tag to compare

🐞 fix #10602 issue with reactive values props update (#10606)
🧑‍🎓 close #10585 update controller value on each render (#10586)
🧪 test(generated-id): setting window performance undefined without ts-ignore (#10584)

thanks to @mateoguzmana

Version 7.45.0

19 Jun 11:17
Compare
Choose a tag to compare

🐞 close #10523 equal values prop not reset form values (#10525)
🪲 fix: useFormContext ReturnType (#10543)
⌨️ fix <Form /> onSubmit type overwrite (#10520)
👮‍♀️ enforce stricter type for controller on change callback (#10342)
🪲 fix: invalid test case for useController (#10493)
🎮 build: use up-to-date terser plugin (#10488)
💫 upgrade api-extractor version (#10487)

thanks to @kotarella1110, @Moshyfawn, @swallowtail62 and @bajormar

Version 7.45.0-next.1

18 Jun 22:13
Compare
Choose a tag to compare
Version 7.45.0-next.1 Pre-release
Pre-release

🪲 fix: useFormContext ReturnType (#10543)

thanks to @swallowtail62

Version 7.45.0-next.0

11 Jun 11:10
Compare
Choose a tag to compare
Version 7.45.0-next.0 Pre-release
Pre-release

🐞 close #10523 equal values prop not reset form values (#10525)
⌨️ fix <Form /> onSubmit type overwrite (#10520)
👮‍♀️ enforce stricter type for controller on change callback (#10342)
🪲 fix: invalid test case for useController (#10493)
🎮 build: use up-to-date terser plugin (#10488)
💫 upgrade api-extractor version (#10487)

thanks to @kotarella1110, @Moshyfawn and @bajormar

Version 7.44.3

01 Jun 22:59
Compare
Choose a tag to compare

🦉 fix: add named component export (#10486)
💭 fix React import inconsistency (#10479)
🏙️ fix: removed code from the README updater which was trying to read a non-existent docs/Helpers.yaml
📝 fix doc: update urls from /api to /docs (#10468)

thanks to @Moshyfawn @@protofarer @farfromrest

Version 7.44.2

28 May 23:04
Compare
Choose a tag to compare

🪟 fix #10456 object.hasown replaced with hasOwnProperty (#10458)