๐ React Hooks for form state management and validation (Web + React Native)
MIT License
Bot releases are hidden (Show)
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
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
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
Published by bluebill1049 over 1 year ago
๐ชฒ fix: useFormContext ReturnType (#10543)
thanks to @swallowtail62
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
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
Published by bluebill1049 over 1 year ago
๐ช fix #10456 object.hasown
replaced with hasOwnProperty
(#10458)
Published by bluebill1049 over 1 year ago
๐ fix <Form />
component content-type json type missing (#10454)
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
// 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
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)
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
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
Published by bluebill1049 over 1 year ago
๐ Form Component (#9735)
๐ 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
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)"
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
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)
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
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
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)
Published by bluebill1049 over 1 year ago
๐ fix #10021 issue with .next
runtime error and fix cypress action (#10026)