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.45.2

Published by bluebill1049 over 1 year ago

๐Ÿงพ 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

react-hook-form - Version 7.45.1

Published by bluebill1049 over 1 year ago

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

react-hook-form - Version 7.45.0

Published by bluebill1049 over 1 year ago

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

react-hook-form - Version 7.45.0-next.1

Published by bluebill1049 over 1 year ago

๐Ÿชฒ fix: useFormContext ReturnType (#10543)

thanks to @swallowtail62

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

Published by bluebill1049 over 1 year ago

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

react-hook-form - Version 7.44.3

Published by bluebill1049 over 1 year ago

๐Ÿฆ‰ 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

react-hook-form - Version 7.44.2

Published by bluebill1049 over 1 year ago

๐ŸชŸ fix #10456 object.hasown replaced with hasOwnProperty (#10458)

react-hook-form - Version 7.44.1

Published by bluebill1049 over 1 year ago

๐Ÿž fix <Form /> component content-type json type missing (#10454)

react-hook-form - Version 7.44.0

Published by bluebill1049 over 1 year ago

๐Ÿ“„ New <Form /> Component (https://github.com/react-hook-form/react-hook-form/pull/9735)

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

  • add try and catch for JSON.stringify
// Send post request with formData
<Form
  action="/api"
  control={control}
  onSuccess={() => {
    alert("Great");
  }}
/>

// Send post request with json form data
<Form action="/api" encType="application/json" headers={{ accessToken: 'test' }}> 
  {errors.root?.server.type === 500 && 'Error message'}
  {errors.root?.server.type === 400 && 'Error message'}
</Form>

// Send post request with formData with fetch
<Form
  onSubmit={async ({ formData, data, formDataJson, event }) => {
    await fetch("api", {
      method: "post",
      body: formData,
    });
  }}
/>

๐Ÿ—๏ธ support TransformedValues with useFormContext (https://github.com/react-hook-form/react-hook-form/pull/10322)

useFormContext<FormValue, TransformedValues>()

๐Ÿš” added TTransformedValues to FormProvider (https://github.com/react-hook-form/react-hook-form/pull/10368)

FormProviderProps<TFieldValues, TContext, TTransformedValues>

๐Ÿž fix https://github.com/react-hook-form/react-hook-form/issues/10139 with errors diff from the previous with field array action (https://github.com/react-hook-form/react-hook-form/pull/10216)
๐Ÿž related https://github.com/react-hook-form/react-hook-form/issues/10238 return default values in watch and useWatch when reset is called with an empty object
๐Ÿฆฎ remove unnecessary as unknown as cast (https://github.com/react-hook-form/react-hook-form/pull/10300)
๐Ÿง›โ€โ™‚๏ธ close https://github.com/react-hook-form/react-hook-form/issues/10277 remove pattern empty string check (https://github.com/react-hook-form/react-hook-form/pull/10279)
๐Ÿž fix https://github.com/react-hook-form/react-hook-form/issues/9037 bugs that occur in the presence of Array polyfills (https://github.com/react-hook-form/react-hook-form/pull/10328)
๐Ÿซฅ close https://github.com/react-hook-form/react-hook-form/issues/10348 stop shouldUseNativeValidation pass down constraint props (https://github.com/react-hook-form/react-hook-form/pull/10350)
๐Ÿ˜ตโ€๐Ÿ’ซ close https://github.com/react-hook-form/react-hook-form/issues/10386 re-register controller input to fix strict mode (https://github.com/react-hook-form/react-hook-form/pull/10418)
โœ๏ธ update form.tsx for TSdoc (https://github.com/react-hook-form/react-hook-form/pull/10399)

thanks to @yasamoka & @Torvin @ryota-murakami & @devakrishna33

react-hook-form - Version 7.44.0-rc.4

Published by bluebill1049 over 1 year ago

๐Ÿ‘” Improve Form component onSubmit and remove fetcher prop (#10425)

<Form 
-  fetcher={(...) => {}}
+  onSubmit={await ({ formData, data, event }) => {
+    await fetch('/api', { body: formData, method: 'post' })
+  }} 
/>
// With action prop, it achieve the same as above
<Form action="/api" />

๐Ÿ˜ตโ€๐Ÿ’ซ close #10386 re-register controller input to fix strict mode (#10418)
โœ๏ธ update form.tsx for TSdoc (#10399)

react-hook-form - Version 7.44.0-rc.3

Published by bluebill1049 over 1 year ago

๐Ÿž fix #9037 bugs that occur in the presence of Array polyfills (#10328)
๐Ÿš” added TTransformedValues to FormProvider (#10368)

FormProviderProps<TFieldValues, TContext, TTransformedValues>

๐Ÿซฅ close #10348 stop shouldUseNativeValidation pass down constraint props (#10350)

thanks to @yasamoka & @Torvin

react-hook-form - Version 7.44.0-rc.2

Published by bluebill1049 over 1 year ago

๐Ÿ—๏ธ support TransformedValues with useFormContext (#10322)

useFormContext<FormValue, TransformedValues>()

๐Ÿฆฎ remove unnecessary as unknown as cast (#10300)
๐Ÿง›โ€โ™‚๏ธ close #10277 remove pattern empty string check (#10279)

thanks to @ryota-murakami

react-hook-form - Version 7.44.0-rc.1

Published by bluebill1049 over 1 year ago

๐Ÿ“„ Form Component (#9735)

  • add try and catch for JSON.stringify

๐Ÿž fix #10139 with errors diff from the previous with field array action (#10216)
๐Ÿž related #10238 return default values in watch and useWatch when reset is called with an empty object

thanks to @devakrishna33

react-hook-form - Version 7.43.9

Published by bluebill1049 over 1 year ago

๐Ÿ„ close #10195 close async defaultValues not load (#10203)
Revert "๐Ÿž fix #10139 useFieldArray array error not updating in some cases (#10150)"

react-hook-form - Version 7.43.8

Published by bluebill1049 over 1 year ago

๐Ÿชก related #10143 did not update dirty until interacted (#10157)
๐Ÿž fix #10139 useFieldArray array error not updating in some cases (#10150)

thanks to @kylemclean

react-hook-form - Version 7.43.7

Published by bluebill1049 over 1 year ago

๐Ÿž fix #10131 regression on NaN data type (#10132)
๐Ÿž fix #10129 useFieldArray unmount fieldArray wihtout register (#10130)
๐Ÿฆถ upgrade to TS 5.0.0 (#9834)

react-hook-form - Version 7.43.6

Published by bluebill1049 over 1 year ago

๐Ÿž fix(appendErrors): incorrect type, it can take an array of errors (#10125)
โœ๏ธ close #10096 react strict mode with mounted field value (#10102)
๐Ÿฆฎ fix: isLoading form state (#10095)
๐Ÿ“ fix: typos in tsdoc (#10088)
๐Ÿฉด close #10078 prevent stabled aysnc validation (#10082)
๐Ÿž fix #10064 native validation when subscribe to isValid (#10072)
๐Ÿ“ correct typo in field array type declaration (#10066)

thanks to @jorisre @chrisbarless @mjw-isp and @adamtowle

react-hook-form - Version 7.44.0-rc.0

Published by bluebill1049 over 1 year ago

๐Ÿ“„ Form Component support custom fetcher with FormData and Json

<Form
  action="/api"
  fetcher={async (
    action,
    { method, values, event, formData, formDataJson }
  ) => {
    await fetch(action, { method, body: formData });
    // or with JSON
    await fetch(action, {
      method,
      header: { "content-type": "application/json" },
      body: formDataJson,
    });
  }}
/>;

๐Ÿ“„ useForm support TTransformedValues

UseFormReturn<TFieldValues, TContext, TTransformedValues>

๐Ÿฉด close #10078 to prevent stabled async validation (#10082)
๐Ÿž fix #10064 native validation when subscribing to isValid (#10072)
๐Ÿ“ correct typo in field array type declaration (#10066)

thanks to @chrisbarless

react-hook-form - Version 7.43.5

Published by bluebill1049 over 1 year ago

๐Ÿฐ prevent runtime error with subscribe function (#10052)
๐Ÿช” close #10045 improve useController defaultValue restore under strict mode with double useEffect (#10049)
๐Ÿ“ท improve form values state update (#10029)

react-hook-form - Version 7.43.4

Published by bluebill1049 over 1 year ago

๐Ÿž fix #10021 issue with .next runtime error and fix cypress action (#10026)