31 KiB
@refinedev/react-hook-form
4.9.1
Patch Changes
-
#6445
4ff4335274d5689ec62127312695b76d692a125aThanks @alicanerdurmaz! - fix: onChange handlerautoSavecheck inuseFormAutosave can now be explicitly disabled.
Resolves #6458
4.9.0
Minor Changes
-
#6161
ff975374efcc05220be4411218c2daf7c19b8995Thanks @ritute! - feat(react-hook-form): update version constraint from^7.30.0to^7.43.5Update react-hook-form version to address runtime subscribe error
Patch Changes
-
#6233
a93eed09796b780557f6fecee0c2f1e7b4f9e93bThanks @alicanerdurmaz! - chore: update@refinedev/coreusage to reflect latest renamings.These changes applied on internal usage of
@refinedev/corein@refinedev/react-hook-formpackage.import { useForm } from '@refinedev/core'; - const { queryResult, mutationResult } = useForm(); + const { query, mutation} = useForm();
4.8.20
Patch Changes
-
6bd14228760d3e1e205ea9248e427f9afa2ec046Thanks @BatuhanW! - chore: addedtypequalifier to imports used as type only.- import { A } from "./example.ts"; + import type { A } from "./example.ts";
4.8.19
Patch Changes
-
#5945
90930b381d8d369c63bc59beedf69c391875166dThanks @aliemir! - chore: addedtypequalifier to imports used as type only.- import { A } from "./example.ts"; + import type { A } from "./example.ts";
4.8.18
Patch Changes
-
#5928
db9756e7908Thanks @aliemir! - fix: type errors on typescript <5Due to the changes in #5881, typescript users below version 5 are facing type errors. This PR fixes the type errors by updating the file extensions required by the
d.mtsdeclaration files to provide a compatible declarations for both typescript 4 and 5 users.
4.8.17
Patch Changes
- #5881
ba719f6ea26Thanks @aliemir! - fix: declaration files in node10, node16 and nodenext module resolutions
4.8.16
Patch Changes
-
#5754
56ed144a0f5Thanks @alicanerdurmaz! - chore: TypeScript upgraded to v5.x.x. #5752fixed: Some type errors are fixed due to the TypeScript upgrade.
-
#5765
0c197d82393Thanks @aliemir! - refactor: package bundles and package.json configuration for exportsPreviously, Refine packages had exported ESM and CJS bundles with same
.jsextension and same types for both with.d.tsextensions. This was causing issues with bundlers and compilers to pick up the wrong files for the wrong environment. Now we're outputting ESM bundles with.mjsextension and CJS bundles with.cjsextension. Also types are now exported with both.d.mtsand.d.ctsextensions.In older versions ESM and CJS outputs of some packages were using wrong imports/requires to dependencies causing errors in some environments. This will be fixed since now we're also enforcing the module type with extensions.
Above mentioned changes also supported with changes in
package.jsonfiles of the packages to support the new extensions and types. All Refine packages now includeexportsfields in their configuration to make sure the correct bundle is picked up by the bundlers and compilers. -
#5765
0c197d82393Thanks @aliemir! - Fixed thelodash-esimports for ESM builds to access the exports properly. -
#5714
38f129f40eeThanks @aliemir! - Due to the bug fix made in the@refinedev/core,onFinishAutoSave's returned promise can now reject and should be handled accordingly. UpdateduseForm's auto save handler to catch the rejection without breaking the application.Additionally due to the same changes,
onFinishshould also be handled accordingly. UpdateduseForm'ssaveButtonProps.onClickto catch the rejection without breaking the application. -
#5755
404b2ef5e1bThanks @BatuhanW! - fix: incorrect type imports
4.8.15
Patch Changes
- #5695
79865affa1cThanks @BatuhanW! - chore: apply biome format and fix lint errors.
4.8.14
Patch Changes
- #5573
546df06482Thanks @alicanerdurmaz! - chore: add "use client" directive to exported files to work with nextjs app router
4.8.13
Patch Changes
- #5425
190af9fce2Thanks @aliemir! - Updated@refinedev/corepeer dependencies to latest (^4.46.1)
4.8.12
Patch Changes
- #5201
760cfbaaa2aThanks @aliemir! - Updated initial value setting logic inuseFormto handle nested objects properly.
4.8.11
Patch Changes
- #5201
760cfbaaa2aThanks @aliemir! - Updated initial value setting logic inuseFormto handle nested objects properly.
4.8.10
Patch Changes
-
#5022
80513a4e42fThanks @BatuhanW! - chore: update README.md- fix grammar errors.
- make all README.md files consistent.
- add code example code snippets.
4.8.9
Patch Changes
-
#5022
80513a4e42fThanks @BatuhanW! - chore: update README.md- fix grammar errors.
- make all README.md files consistent.
- add code example code snippets.
4.8.8
Patch Changes
- #4964
85b1ac0db5fThanks @BatuhanW! - chore: update @refinedev/core peer dependency versions.
4.8.7
Patch Changes
- #4964
85b1ac0db5fThanks @BatuhanW! - chore: update @refinedev/core peer dependency versions.
4.8.6
Patch Changes
- #4903
e327cadc011Thanks @yildirayunlu! - feat: addinvalidateOnUnmountprop touseFormhook. feat: addinvalidateOnUnmountandinvalidateOnCloseprop touseModalFormhook. From now on, you can use these props to invalidate queries upon unmount and/or close
4.8.5
Patch Changes
- #4903
e327cadc011Thanks @yildirayunlu! - feat: addinvalidateOnUnmountprop touseFormhook. feat: addinvalidateOnUnmountandinvalidateOnCloseprop touseModalFormhook. From now on, you can use these props to invalidate queries upon unmount and/or close
4.8.4
Patch Changes
- #4948
8e5efffbb23Thanks @aliemir! - Keep the hook and component names in builds for better debugging.
4.8.3
Patch Changes
- #4948
8e5efffbb23Thanks @aliemir! - Keep the hook and component names in builds for better debugging.
4.8.2
Patch Changes
- #4767
c757355da60Thanks @alicanerdurmaz! - fixed:useModalFormsends request twice whensyncWithLocationis true
4.8.1
Patch Changes
- #4767
c757355da60Thanks @alicanerdurmaz! - fixed:useModalFormsends request twice whensyncWithLocationis true
4.8.0
Minor Changes
- #4741
026ccf34356Thanks @aliemir! - AddedsideEffects: falsetopackage.jsonto help bundlers tree-shake unused code.
4.7.0
Minor Changes
- #4741
026ccf34356Thanks @aliemir! - AddedsideEffects: falsetopackage.jsonto help bundlers tree-shake unused code.
4.6.0
Minor Changes
-
#4652
96af6d25b7aThanks @alicanerdurmaz! - feat: when thedataProviderreturns rejected promise witherrorsfield,useFormwill automatically update the error state with the rejectederrorsfield.Refer to the server-side form validation documentation for more information. →
4.5.0
Minor Changes
-
#4652
96af6d25b7aThanks @alicanerdurmaz! - feat: when thedataProviderreturns rejected promise witherrorsfield,useFormwill automatically update the error state with the rejectederrorsfield.Refer to the server-side form validation documentation for more information. →
4.4.2
Patch Changes
-
#4576
9a895ea39dcThanks @alicanerdurmaz! - fixed:handleSubmitReactHookFormnow returns a Promise without awaiting it. With this change, unhandled errors will propagate to the caller. -
#4527
ceadcd29fc9Thanks @salihozdemir! - fix: prioritization of forgottenidentifierIf
identifieris provided, it will be used instead ofname.import { useModalForm } from "@refinedev/react-hook-form"; useModalForm({ refineCoreProps: { resource: "identifier-value", }, });fix: use translate keys with
identifierPreviously, the translate keys were generated using resource
name. This caused issues when you had multipleresourceusage with the same name. Now thetranslatekeys are generated usingidentifierif it's present.
4.4.1
Patch Changes
-
#4576
9a895ea39dcThanks @alicanerdurmaz! - fixed:handleSubmitReactHookFormnow returns a Promise without awaiting it. With this change, unhandled errors will propagate to the caller. -
#4527
ceadcd29fc9Thanks @salihozdemir! - fix: prioritization of forgottenidentifierIf
identifieris provided, it will be used instead ofname.import { useModalForm } from "@refinedev/react-hook-form"; useModalForm({ refineCoreProps: { resource: "identifier-value", }, });fix: use translate keys with
identifierPreviously, the translate keys were generated using resource
name. This caused issues when you had multipleresourceusage with the same name. Now thetranslatekeys are generated usingidentifierif it's present.
4.4.0
Minor Changes
- #4306
e6eb4dea627Thanks @yildirayunlu! - feat:syncWithLocation.syncIddefault totrueforuseModalForm.
4.3.0
Minor Changes
- #4306
e6eb4dea627Thanks @yildirayunlu! - feat:syncWithLocation.syncIddefault totrueforuseModalForm.
4.2.4
Patch Changes
- #4241
fbe109b5a8bThanks @salihozdemir! - Added new generic types to theuseFormhooks. Now you can pass the query types and the mutation types to the hook.
4.2.3
Patch Changes
- #4241
fbe109b5a8bThanks @salihozdemir! - Added new generic types to theuseFormhooks. Now you can pass the query types and the mutation types to the hook.
4.2.2
Patch Changes
- #4210
b992e11e338Thanks @alicanerdurmaz! - fixed: The values of the registered fields were set using thereset()function. This has been changed to usegetValues()instead. This fixes an issue where the values of the registered fields' dirty state were not being set correctly.
4.2.1
Patch Changes
- #4210
b992e11e338Thanks @alicanerdurmaz! - fixed: The values of the registered fields were set using thereset()function. This has been changed to usegetValues()instead. This fixes an issue where the values of the registered fields' dirty state were not being set correctly.
4.2.0
Minor Changes
-
#4113
1c13602e308Thanks @salihozdemir! - Added missing third generic parameter to hooks which are usinguseQueryinternally.For example:
import { useOne, HttpError } from "@refinedev/core"; const { data } = useOne<{ count: string }, HttpError, { count: number }>({ resource: "product-count", queryOptions: { select: (rawData) => { return { data: { count: Number(rawData?.data?.count), }, }; }, }, }); console.log(typeof data?.data.count); // number
4.1.6
Patch Changes
- #4120
1f310bd7b69Thanks @aliemir! - Fix brokenuseModalFormwithcreateactions.
4.1.5
Patch Changes
- #4120
1f310bd7b69Thanks @aliemir! - Fix brokenuseModalFormwithcreateactions.
4.1.4
Patch Changes
- #4114
afdaed3dd83Thanks @aliemir! - UpdateduseModalFormhook'smodal.showmethod to check if there's anidpresent or provided. If there is, it will continue to show the modal. If not, the modal will not show. (Resolves #4062)
4.1.3
Patch Changes
- #4114
afdaed3dd83Thanks @aliemir! - UpdateduseModalFormhook'smodal.showmethod to check if there's anidpresent or provided. If there is, it will continue to show the modal. If not, the modal will not show. (Resolves #4062)
4.1.2
Patch Changes
- #3909
631512e91ecThanks @salihozdemir! - Fixed a bug that the form values were not filled when the user next to steps.
4.1.1
Patch Changes
- #3909
631512e91ecThanks @salihozdemir! - Fixed a bug that the form values were not filled when the user next to steps.
4.1.0
Minor Changes
-
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! All
react-hook-formimports re-exported from@refinedev/react-hook-formhave been removed. You should import them from thereact-hook-formpackage directly.If the package is not installed, you can install it with your package manager:
npm install react-hook-form # or pnpm add react-hook-form # or yarn add react-hook-formAfter that, you can import them from
react-hook-formpackage directly.- import { useForm, Controller } from "@refinedev/react-hook-form"; + import { useForm } from "@refinedev/react-hook-form"; + import { Controller } from "react-hook-form"; -
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! Updated the components to match the changes in routing system of
@refinedev/core.metaproperty in componentsThis includes
metaprops in buttons andSidercomponent.metaproperty can be used to pass additional parameters to the navigation paths.For a
postsresource definition like this:<Refine resources={[ { name: "posts", list: "/posts", show: "/:authorId/posts/:id", } ]} >You can pass
authorIdto theShowButtoncomponent like this:<ShowButton resource="posts" id="1" meta={{ authorId: 123 }}>This will navigate to
/123/posts/1path. -
Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! Moving to the
@refinedevscope 🎉🎉Moved to the
@refinedevscope and updated our packages to use the new scope. From now on, all packages will be published under the@refinedevscope with their new names.Now, we're also removing the
refineprefix from all packages. So, the@pankod/refine-corepackage is now@refinedev/core,@pankod/refine-antdis now@refinedev/antd, and so on.
Patch Changes
3.39.0
Minor Changes
- #3822
0baa99ba787Thanks @BatuhanW! - - refine v4 release announcement added to "postinstall". - refine v4 is released 🎉 The new version is 100% backward compatible. You can upgrade to v4 with a single command! See the migration guide here: https://refine.dev/docs/migration-guide/3x-to-4x
3.38.0
Minor Changes
- #3822
0baa99ba787Thanks @BatuhanW! - - refine v4 release announcement added to "postinstall". - refine v4 is released 🎉 The new version is 100% backward compatible. You can upgrade to v4 with a single command! See the migration guide here: https://refine.dev/docs/migration-guide/3x-to-4x
3.37.2
Patch Changes
- #3307
1262f2c4589Thanks @omeraplak! - Fixed resetting values on step changes - #3290
3.37.1
Patch Changes
- #3307
1262f2c4589Thanks @omeraplak! - Fixed resetting values on step changes - #3290
3.37.0
Minor Changes
- #3209
e0279bce6f1Thanks @yildirayunlu! - Export all types.
3.36.0
Minor Changes
- #3209
e0279bce6f1Thanks @yildirayunlu! - Export all types.
3.35.0
Minor Changes
- #3196
78b3fd90fcfThanks @yildirayunlu! - ExportUseFieldArrayReplacetype fromreact-hook-form.
3.34.0
Minor Changes
- #3196
78b3fd90fcfThanks @yildirayunlu! - ExportUseFieldArrayReplacetype fromreact-hook-form.
3.33.2
Patch Changes
- Fixed version of react-router to
6.3.0
3.33.1
Patch Changes
- #2501
4095a578d4Thanks @omeraplak! - Fixed version of react-router to6.3.0
3.33.0
Minor Changes
- Update type declaration generation with
tscinstead oftsupfor better navigation throughout projects source code.
3.32.0
Minor Changes
- #2440
0150dcd070Thanks @aliemir! - Update type declaration generation withtscinstead oftsupfor better navigation throughout projects source code.
3.31.4
Patch Changes
- Added type checking to fix fields reset bug
3.31.3
Patch Changes
- #2296
cca5a3d0c1Thanks @ozkalai! - Added type checking to fix fields reset bug
3.31.2
Patch Changes
- Fixed immediate triggering of
handleSubmit
3.31.1
Patch Changes
- #2288
6847672849Thanks @omeraplak! - Fixed immediate triggering ofhandleSubmit
3.31.0
Minor Changes
- Add React@18 support 🚀
3.30.0
Minor Changes
- #1718
b38620d842Thanks @omeraplak! - Add React@18 support 🚀
3.29.0
Minor Changes
-
All of the refine packages have dependencies on the
@pankod/refine-corepackage. So far we have managed these dependencies withpeerDependencies+dependenciesbut this causes issues like #2183. (having more than one @pankod/refine-core version in node_modules and creating different instances)Managing as
peerDependencies+devDependenciesseems like the best way for now to avoid such issues.
3.28.0
Minor Changes
-
#2217
b4aae00f77Thanks @omeraplak! - All of the refine packages have dependencies on the@pankod/refine-corepackage. So far we have managed these dependencies withpeerDependencies+dependenciesbut this causes issues like #2183. (having more than one @pankod/refine-core version in node_modules and creating different instances)Managing as
peerDependencies+devDependenciesseems like the best way for now to avoid such issues.
3.27.2
Patch Changes
- Fixed a bug that prevented modal or drawer from closing after submit.
3.27.1
Patch Changes
- #1931
4012d3c4aeThanks @salihozdemir! - Fixed a bug that prevented modal or drawer from closing after submit.
3.27.0
Minor Changes
-
Removed
saveButtonPropsexported fromuseModalFormbecausesaveButtonPropsis already exported fromuseFormhook in@pankod/refine-react-hook-form.const { modal: { - saveButtonProps }, + saveButtonProps } = useModalForm();
3.26.0
Minor Changes
-
#1923
45cd1f7097Thanks @salihozdemir! - RemovedsaveButtonPropsexported fromuseModalFormbecausesaveButtonPropsis already exported fromuseFormhook in@pankod/refine-react-hook-form.const { modal: { - saveButtonProps }, + saveButtonProps } = useModalForm();
3.23.0
Minor Changes
- #1866
9c72dae441Thanks @salihozdemir! - ChangeisBackValidatedefault value tofalseforuseStepsForm.
3.22.2
Patch Changes
-
#1873
2deb19babfThanks @aliemir! - Removed dummy default values from internal contexts. Updated contexts:- Auth
- Access Control
- Notification
- Translation (i18n)
- unsavedWarn
BREAKING:
useGetLocalehook now can returnundefinedinstead of a fallback value ofenin cases ofi18nProviderbeingundefined. -
Updated dependencies [
2deb19babf]:- @pankod/refine-core@3.23.2