Skip to content

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

Version 7.44.1

27 May 06:54
Compare
Choose a tag to compare

🐞 fix <Form /> component content-type json type missing (#10454)

Version 7.44.0

27 May 01:19
Compare
Choose a tag to compare

📄 New <Form /> Component (#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 (#10322)

useFormContext<FormValue, TransformedValues>()

🚔 added TTransformedValues to FormProvider (#10368)

FormProviderProps<TFieldValues, TContext, TTransformedValues>

🐞 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
🦮 remove unnecessary as unknown as cast (#10300)
🧛‍♂️ close #10277 remove pattern empty string check (#10279)
🐞 fix #9037 bugs that occur in the presence of Array polyfills (#10328)
🫥 close #10348 stop shouldUseNativeValidation pass down constraint props (#10350)
😵‍💫 close #10386 re-register controller input to fix strict mode (#10418)
✍️ update form.tsx for TSdoc (#10399)

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

Version 7.44.0-rc.4

20 May 04:49
Compare
Choose a tag to compare
Version 7.44.0-rc.4 Pre-release
Pre-release

👔 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)

Version 7.44.0-rc.3

07 May 00:17
Compare
Choose a tag to compare
Version 7.44.0-rc.3 Pre-release
Pre-release

🐞 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

Version 7.44.0-rc.2

22 Apr 07:00
Compare
Choose a tag to compare
Version 7.44.0-rc.2 Pre-release
Pre-release

🗝️ 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

Version 7.44.0-rc.1

15 Apr 02:33
Compare
Choose a tag to compare
Version 7.44.0-rc.1 Pre-release
Pre-release

📄 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

Version 7.43.9

30 Mar 21:17
Compare
Choose a tag to compare

🍄 close #10195 close async defaultValues not load (#10203)
Revert "🐞 fix #10139 useFieldArray array error not updating in some cases (#10150)"

Version 7.43.8

24 Mar 22:07
Compare
Choose a tag to compare

🪡 related #10143 did not update dirty until interacted (#10157)
🐞 fix #10139 useFieldArray array error not updating in some cases (#10150)

thanks to @kylemclean

Version 7.43.7

18 Mar 02:01
Compare
Choose a tag to compare

🐞 fix #10131 regression on NaN data type (#10132)
🐞 fix #10129 useFieldArray unmount fieldArray wihtout register (#10130)
🦶 upgrade to TS 5.0.0 (#9834)

Version 7.43.6

17 Mar 10:04
Compare
Choose a tag to compare

🐞 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