react-hook-form

๐Ÿ“‹ React Hooks for form state management and validation (Web + React Native)

MIT License

Downloads
25.6M
Stars
39.4K
Committers
318

Bot releases are visible (Hide)

react-hook-form - Version 7.51.3 Latest Release

Published by bluebill1049 6 months ago

๐Ÿž fix #11773 regression on dirty check with reset (#11775)

react-hook-form - Version 7.51.2

Published by bluebill1049 7 months ago

๐Ÿž fix #11719 validation stuck on true state (#11723)

react-hook-form - Version 7.51.1

Published by bluebill1049 7 months ago

๐Ÿ› bug(validatingFields, trigger): handle all fields validation trigger (#11624)
๐Ÿ’š ci: cleanup actions versions (#11629)
๐Ÿž fix #11590 issue with trigger on validatingFields (#11613)

thanks to @Moshyfawn

react-hook-form - Version 7.51.0

Published by bluebill1049 8 months ago

๐Ÿ’ฌ add isValidating and validatingFields to field state (#10657)

const { formState: { validatingFields } } = useForm({ mode: 'onBlur' });

โŒจ๏ธ chore: replace ts-ignore with ts-expect-error (#11573)
๐Ÿง—โ€โ™‚๏ธ chore: update lib dev deps (#11548)
๐Ÿ’… related #11541 improve dirty check when undefined provided with reset api
๐Ÿ˜พ fix #11514 issue under strict mode reset invoke twice reset mounted field names with keepDirtyValues (#11546)
๐Ÿคก fix flush root render hack (#11521)
๐Ÿงฝ chore: removed unused utils and resp. test cases (#11476)
๐Ÿž close #11503 issue dirty field update with async validation (#11509)

Revert "๐Ÿ”ง fix data param in handleSubmit when TTransformedValues is a union type (#11420)"
Revert "โœจ feat(values): priorities values over defaultvalues (#11399)" (#11545)

โค๏ธ Thanks to @deepgolani4, @pbankonier and @deepgolani4
โค๏ธ Thank you principal.com for your contribution

react-hook-form - Version v7.50.1

Published by bluebill1049 9 months ago

๐Ÿฅฒ Regression: Revert "โŒจ๏ธ fix #10734 watch and useWatch without parameters return type (#11359)"

react-hook-form - Versions 7.50.0

Published by bluebill1049 9 months ago

๐Ÿ”ง fix data param in handleSubmit when TTransformedValues is a union type (#11420)
๐Ÿ‘ท build(Engines): remove pnpm dependency (#11425)
๐Ÿž fixes #11386 get new dirtyFields when reset keeping defaults and dirty values (#11401)
๐Ÿท๏ธ improve CustomElement type (#11309)
๐Ÿ’ซ feat(useForm): leave formState flags in a consistent state when throwing in handleSubmit onValid (#11214)
โŒจ๏ธ fix: change DeepPartial to account for object union types & unknown (#11385)
โœจ feat(values): priorities values over defaultvalues (#11399)
๐Ÿž close #11246 skip root validation on action when mode and revalidate mode is onSubmit (#11395)
๐Ÿ’ฉ fix #11322 trigger extra re-render with useWatch plus shouldUnregister (#11394)
โŒจ๏ธ fix #10734 watch and useWatch without parameters return type (#11359)
๐Ÿง‘โ€โœˆ๏ธ fix #11281 issue with upgrade node version (#11392)
๐Ÿž fix #11368 keep form state mounted when keeping values (#11384)
๐Ÿž fix #11374: Nested deep partial with unknown (#11373)

thanks to @Moshyfawn, @jonahallibone, @eladattias1996, @RulerOfCakes, @anonkey, @Ar4ys, @IanVS and @r-kataoka11

react-hook-form - Version 7.49.3

Published by bluebill1049 10 months ago

๐Ÿ› fix(formState, disabled): infer controlled disabled form state (#11361)
๐Ÿ› fix(reset): remove global reset option flag (#11355)
๐Ÿ› fix(useController): check if disabled state was set by user (#11353)
๐Ÿ–จ๏ธ fix: Change DeepPartial type definition to be compatible with unknown (#11333)
๐Ÿž fix #11328 resetField with object as defaultValue (#11329)

thanks to @Moshyfawn, @geeee and @RulerOfCakes

react-hook-form - Version 7.49.2

Published by bluebill1049 10 months ago

๐Ÿž fix #11292 issue with controller validation prop (#11294)

react-hook-form - Version 7.49.1

Published by bluebill1049 10 months ago

๐Ÿž fix #11276 issue with disabled omit on Controller (#11277)
๐Ÿž fix #11287 disabled prop cause const dirtyFields update (#11291)

react-hook-form - ๐ŸŽ„ Version 7.49.0

Published by bluebill1049 11 months ago

๐Ÿ“ฎ feat: add reactive errors prop at useForm (#11188)

useForm({
  errors, // server errors
})

๐Ÿ–ฅ๏ธ feat: add react-server bundle (#11162)
๐Ÿ”ฉ chore: upgrade Node.js and pnpm (#11163)
๐Ÿช– feat: add ValidationModeFlags Type (#11144)
๐Ÿž fix #11267 disabled prop does not affect controller validation (#11273)
๐Ÿ”ง refactor(util function): Enhance Consistency in Utility Functions: Standardizing Export, Function Types, and Naming (#11268)
โŒจ๏ธ change type structure of UseFormHandleSubmit (#11245)
๐Ÿ“ฎ fix(#11239): Set fields disabled state based on form and field disabled (#11241)
๐Ÿข improved getDirtyFieldsFromDefaultValues type (#11238)
๐Ÿž fix #11229 issue with values not re-render the root form (#11231)
๐Ÿž fix #11218 useFieldArray focus issue with rules prop (#11221)
๐Ÿ”ง chore: improved isObjectType and swap (#11183)

thanks to @kotarella1110, @ssi02014, @thomasdbock, @mildfuzz and @Lennon57

react-hook-form - Version 7.48.2

Published by bluebill1049 12 months ago

๐Ÿž #11106 fix disabled prop not update dirty formState (#11143)
๐Ÿž fix controller update with disabled prop from useForm (#11142)

react-hook-form - Version 7.48.1

Published by bluebill1049 12 months ago

๐Ÿž fix controller update with disabled prop from useForm

react-hook-form - Version 7.48.0

Published by bluebill1049 12 months ago

๐Ÿงฑ feature: disable prop for useForm (#10496)

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

  return (
    <form
      onSubmit={handleSubmit(async () => {
        setDisabled(true);
        await sleep(100);
        setDisabled(false);
      })}
    / >
  );
}

๐Ÿ˜ตโ€๐Ÿ’ซ fixed typo in useFormContext (#11126)
๐Ÿซก strictly manage constants and improve types (#11101)
๐Ÿž fix #11076 disable toggle issue (#11090)
๐Ÿš€ fix: Solve the issue of race condition with resolver. (#10991)
๐Ÿ“– docs: fix useWatch example syntax error (#11005)
๐Ÿ“ readme arabic version (#10992)

thanks to @Iyadchafroud @domuk-k @mehunk @ssi02014 and @tykhan

react-hook-form - Version 7.47.0

Published by bluebill1049 about 1 year ago

๐Ÿซก allow keepIsSubmitSuccessful flag (#9640)

const { reset } = useForm()

<Form
  onSubmit={() => {
    reset(formValues, {
      keepIsSubmitSuccessful: true,
    });
  }}
/>

๐Ÿฆ‰ fix typo in form.ts (#10978)
๐Ÿคก close #10907 potential fix on unmounted component (#10980)
๐Ÿช– simplify logic for subscription by name (#10947)

thanks to @stefanpl, @kai-dorschner-twinsity & @nitschSB

react-hook-form - Version 7.46.2

Published by bluebill1049 about 1 year ago

๐Ÿž fix implicit type coercion (#10949)
๐Ÿ™„ close #10932 omit disabled prop when not defined (#10937)
๐Ÿ”ง fix controller test is dirty (#10899)

thanks to @samimakicc & @pierluigigiancola

react-hook-form - Version 7.46.1

Published by bluebill1049 about 1 year ago

๐Ÿž fix #10878 return disabled field state (#10879)

thanks to @Moshyfawn

react-hook-form - Version 7.46.0

Published by bluebill1049 about 1 year ago

๐ŸงŸโ€โ™‚๏ธ feat: support disabled prop for useController (#10810)

const [disabled, setDisabled] = useState(false)
useController({
  disabled
})
  • field value will be disabled
  • field value will be omitted

๐Ÿซ– prevent reset argument mutation (#10847)
๐Ÿž fix: add exact option for array name in useWatch. (#10707)
๐Ÿž update isDirty when setting disabled in register (#10805)
๐Ÿงถ feat: trigger passed names to construct resolver options (#10590)

thanks to @selimb @vonagam @jgullstr and @rabbitson87

react-hook-form - Version 7.46.0-next.0

Published by bluebill1049 about 1 year ago

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>
  );
}
react-hook-form - Version 7.45.4

Published by bluebill1049 about 1 year ago

๐Ÿž 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

react-hook-form - Version 7.45.3

Published by bluebill1049 about 1 year ago

๐Ÿ“ผ 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