Skip to content

@refinedev/[email protected]

Compare
Choose a tag to compare
@refine-bot refine-bot released this 15 Oct 06:51
· 48 commits to master since this release
3740bf6

Minor Changes

  • #6330 5a81b35bc1eedbecb4b6c531a2fa5235dd0caf31 Thanks @alicanerdurmaz! - feat: add <Link /> component to navigate to a resource with a specific action. Under the hood, It uses useGo to generate the URL.

    Usage

    import { Link } from "@refinedev/core";
    
    const MyComponent = () => {
      return (
        <>
          {/* simple usage, navigates to `/posts` */}
          <Link to="/posts">Posts</Link>
          {/* complex usage with more control, navigates to `/posts` with query filters */}
          <Link
            go={{
              query: {
                // `useTable` or `useDataGrid` automatically use this filters to fetch data if `syncWithLocation` is true.
                filters: [
                  {
                    operator: "eq",
                    value: "published",
                    field: "status",
                  },
                ],
              },
              to: {
                resource: "posts",
                action: "list",
              },
            }}
          >
            Posts
          </Link>
        </>
      );
    };

    Fixes #6329

  • #6330 5a81b35bc1eedbecb4b6c531a2fa5235dd0caf31 Thanks @alicanerdurmaz! - chore: From now on, useLink returns <Link /> component instead of returning routerProvider.Link.

    Since the <Link /> component uses routerProvider.Link under the hood with leveraging useGo hook to generate the URL there is no breaking change. It's recommended to use the <Link /> component from the @refinedev/core package instead of useLink hook. This hook is used mostly for internal purposes and is only exposed for customization needs.

    Fixes #6329

Patch Changes

  • #6327 c630b090539082b5166b508053f87274624c794e Thanks @Anonymous961! - fix(core): added ability to return undefined to fallback to the default notification config when using the function form in successNotification and errorNotification props.

    Resolves #6270

  • #6353 a0f2d7bbef3093e11c3024bb7fa2a0ffc3ce9e10 Thanks @alicanerdurmaz! - fix: The label and route fields in useMenu().menuItems were marked as deprecated, but they are not actually deprecated. This issue was caused by menuItems extending from IResourceItem, however, menuItems populates these fields and handles deprecation of these fields internally. This change removes the deprecation warning for these fields.

    export const Sider = () => {
      const { menuItems } = useMenu();
      menuItems.map((item) => {
        // these are safe to use
        console.log(item.label);
        console.log(item.route);
        item.children.map((child) => {
          // these are safe to use
          console.log(child.label);
          console.log(child.route);
        });
      });
    
      return <div>{/* ... */}</div>;
    };

    Fixes #6352

  • #6386 bfe28f0316b3623aaef0b60ae39ebe24939dd0af Thanks @hugorezende! - fix(core): wrap setFilters and setSorters methods with useCallback to prevent looping re-renders

    With this we can use the setFilters as dependencies inside useEffects without infinite loop since state changes in the hook won't cause the functions to be re-assigned

    Fixes #6385