OpenPanel/packages/react-hook-form/CHANGELOG.md
2024-02-05 10:23:04 +01:00

25 KiB

@refinedev/react-hook-form

4.8.13

Patch Changes

4.8.12

Patch Changes

  • #5201 760cfbaaa2a Thanks @aliemir! - Updated initial value setting logic in useForm to handle nested objects properly.

4.8.11

Patch Changes

  • #5201 760cfbaaa2a Thanks @aliemir! - Updated initial value setting logic in useForm to handle nested objects properly.

4.8.10

Patch Changes

  • #5022 80513a4e42f Thanks @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 80513a4e42f Thanks @BatuhanW! - chore: update README.md

    • fix grammar errors.
    • make all README.md files consistent.
    • add code example code snippets.

4.8.8

Patch Changes

4.8.7

Patch Changes

4.8.6

Patch Changes

  • #4903 e327cadc011 Thanks @yildirayunlu! - feat: add invalidateOnUnmount prop to useForm hook. feat: add invalidateOnUnmount and invalidateOnClose prop to useModalForm hook. From now on, you can use these props to invalidate queries upon unmount and/or close

4.8.5

Patch Changes

  • #4903 e327cadc011 Thanks @yildirayunlu! - feat: add invalidateOnUnmount prop to useForm hook. feat: add invalidateOnUnmount and invalidateOnClose prop to useModalForm hook. From now on, you can use these props to invalidate queries upon unmount and/or close

4.8.4

Patch Changes

4.8.3

Patch Changes

4.8.2

Patch Changes

4.8.1

Patch Changes

4.8.0

Minor Changes

  • #4741 026ccf34356 Thanks @aliemir! - Added sideEffects: false to package.json to help bundlers tree-shake unused code.

4.7.0

Minor Changes

  • #4741 026ccf34356 Thanks @aliemir! - Added sideEffects: false to package.json to help bundlers tree-shake unused code.

4.6.0

Minor Changes

4.5.0

Minor Changes

4.4.2

Patch Changes

  • #4576 9a895ea39dc Thanks @alicanerdurmaz! - fixed: handleSubmitReactHookForm now returns a Promise without awaiting it. With this change, unhandled errors will propagate to the caller.

  • #4527 ceadcd29fc9 Thanks @salihozdemir! - fix: prioritization of forgotten identifier

    If identifier is provided, it will be used instead of name.

    import { useModalForm } from "@refinedev/react-hook-form";
    
    useModalForm({
        refineCoreProps: {
            resource: "identifier-value",
        },
    });
    

    fix: use translate keys with identifier

    Previously, the translate keys were generated using resource name. This caused issues when you had multiple resource usage with the same name. Now the translate keys are generated using identifier if it's present.

4.4.1

Patch Changes

  • #4576 9a895ea39dc Thanks @alicanerdurmaz! - fixed: handleSubmitReactHookForm now returns a Promise without awaiting it. With this change, unhandled errors will propagate to the caller.

  • #4527 ceadcd29fc9 Thanks @salihozdemir! - fix: prioritization of forgotten identifier

    If identifier is provided, it will be used instead of name.

    import { useModalForm } from "@refinedev/react-hook-form";
    
    useModalForm({
        refineCoreProps: {
            resource: "identifier-value",
        },
    });
    

    fix: use translate keys with identifier

    Previously, the translate keys were generated using resource name. This caused issues when you had multiple resource usage with the same name. Now the translate keys are generated using identifier if it's present.

4.4.0

Minor Changes

4.3.0

Minor Changes

4.2.4

Patch Changes

  • #4241 fbe109b5a8b Thanks @salihozdemir! - Added new generic types to the useForm hooks. Now you can pass the query types and the mutation types to the hook.

4.2.3

Patch Changes

  • #4241 fbe109b5a8b Thanks @salihozdemir! - Added new generic types to the useForm hooks. Now you can pass the query types and the mutation types to the hook.

4.2.2

Patch Changes

  • #4210 b992e11e338 Thanks @alicanerdurmaz! - fixed: The values of the registered fields were set using the reset() function. This has been changed to use getValues() 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 b992e11e338 Thanks @alicanerdurmaz! - fixed: The values of the registered fields were set using the reset() function. This has been changed to use getValues() 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 1c13602e308 Thanks @salihozdemir! - Added missing third generic parameter to hooks which are using useQuery internally.

    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

4.1.5

Patch Changes

4.1.4

Patch Changes

  • #4114 afdaed3dd83 Thanks @aliemir! - Updated useModalForm hook's modal.show method to check if there's an id present 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 afdaed3dd83 Thanks @aliemir! - Updated useModalForm hook's modal.show method to check if there's an id present 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

4.1.1

Patch Changes

4.1.0

Minor Changes

  • Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! All react-hook-form imports re-exported from @refinedev/react-hook-form have been removed. You should import them from the react-hook-form package 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-form
    

    After that, you can import them from react-hook-form package 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.

    meta property in components

    This includes meta props in buttons and Sider component. meta property can be used to pass additional parameters to the navigation paths.

    For a posts resource definition like this:

    <Refine
        resources={[
            {
                name: "posts",
                list: "/posts",
                show: "/:authorId/posts/:id",
            }
        ]}
    >
    

    You can pass authorId to the ShowButton component like this:

    <ShowButton resource="posts" id="1" meta={{ authorId: 123 }}>
    

    This will navigate to /123/posts/1 path.

  • Thanks @aliemir, @alicanerdurmaz, @batuhanW, @salihozdemir, @yildirayunlu, @recepkutuk! Moving to the @refinedev scope 🎉🎉

    Moved to the @refinedev scope and updated our packages to use the new scope. From now on, all packages will be published under the @refinedev scope with their new names.

    Now, we're also removing the refine prefix from all packages. So, the @pankod/refine-core package is now @refinedev/core, @pankod/refine-antd is now @refinedev/antd, and so on.

Patch Changes

3.39.0

Minor Changes

3.38.0

Minor Changes

3.37.2

Patch Changes

3.37.1

Patch Changes

3.37.0

Minor Changes

3.36.0

Minor Changes

3.35.0

Minor Changes

3.34.0

Minor Changes

3.33.2

Patch Changes

  • Fixed version of react-router to 6.3.0

3.33.1

Patch Changes

3.33.0

Minor Changes

  • Update type declaration generation with tsc instead of tsup for better navigation throughout projects source code.

3.32.0

Minor Changes

  • #2440 0150dcd070 Thanks @aliemir! - Update type declaration generation with tsc instead of tsup for better navigation throughout projects source code.

3.31.4

Patch Changes

  • Added type checking to fix fields reset bug

3.31.3

Patch Changes

3.31.2

Patch Changes

  • Fixed immediate triggering of handleSubmit

3.31.1

Patch Changes

3.31.0

Minor Changes

  • Add React@18 support 🚀

3.30.0

Minor Changes

3.29.0

Minor Changes

  • All of the refine packages have dependencies on the @pankod/refine-core package. So far we have managed these dependencies with peerDependencies + dependencies but this causes issues like #2183. (having more than one @pankod/refine-core version in node_modules and creating different instances)

    Managing as peerDependencies + devDependencies seems like the best way for now to avoid such issues.

3.28.0

Minor Changes

  • #2217 b4aae00f77 Thanks @omeraplak! - All of the refine packages have dependencies on the @pankod/refine-core package. So far we have managed these dependencies with peerDependencies + dependencies but this causes issues like #2183. (having more than one @pankod/refine-core version in node_modules and creating different instances)

    Managing as peerDependencies + devDependencies seems 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

3.27.0

Minor Changes

  • Removed saveButtonProps exported from useModalForm because saveButtonProps is already exported from useForm hook in @pankod/refine-react-hook-form.

     const {
       modal: {
    -    saveButtonProps
       },
    +  saveButtonProps
     } = useModalForm();
    

3.26.0

Minor Changes

  • #1923 45cd1f7097 Thanks @salihozdemir! - Removed saveButtonProps exported from useModalForm because saveButtonProps is already exported from useForm hook in @pankod/refine-react-hook-form.

     const {
       modal: {
    -    saveButtonProps
       },
    +  saveButtonProps
     } = useModalForm();
    

3.23.0

Minor Changes

3.22.2

Patch Changes

  • #1873 2deb19babf Thanks @aliemir! - Removed dummy default values from internal contexts. Updated contexts:

    • Auth
    • Access Control
    • Notification
    • Translation (i18n)
    • unsavedWarn

    BREAKING: useGetLocale hook now can return undefined instead of a fallback value of en in cases of i18nProvider being undefined.

  • Updated dependencies [2deb19babf]:

    • @pankod/refine-core@3.23.2