Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] label and route fields of useMenu().menuItems shouldn't be deprecated #6352

Closed
alicanerdurmaz opened this issue Sep 18, 2024 · 0 comments · Fixed by #6353, #6336 or #6404
Closed

[BUG] label and route fields of useMenu().menuItems shouldn't be deprecated #6352

alicanerdurmaz opened this issue Sep 18, 2024 · 0 comments · Fixed by #6353, #6336 or #6404
Assignees
Labels
bug Something isn't working

Comments

@alicanerdurmaz
Copy link
Member

alicanerdurmaz commented Sep 18, 2024

Describe the bug

The label and route fields in useMenu().menuItems were marked as deprecated, but they are not deprecated. This issue was caused by menuItems extending from IResourceItem, however, menuItems populates these fields and handles deprecation of these fields internally.

reproducible example code screenshot

Steps To Reproduce

use, useMenu anywhere in your project and check the deprecation warning.

export const Sider = () => {
  const { menuItems } = useMenu();
  menuItems.map((item) => {
    console.log(item.label);
    console.log(item.route);
    item.children.map((child) => {
      console.log(child.label);
      console.log(child.route);
    });
  });

  return <div>{/* ... */}</div>;
};

Expected behavior

The label and route fields in useMenu().menuItems shouldn't be deprecated.

Packages

System:

  • OS: macOS 14.5
  • CPU: (10) arm64 Apple M2 Pro

Binaries:

  • Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
  • Yarn: 1.22.17 - /opt/homebrew/bin/yarn
  • npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm

Browsers:

  • Chrome: 129.0.6668.58
  • Safari: 17.5

Refine Packages:

  • @refinedev/antd: 5.43.1
  • @refinedev/cli: 2.16.38
  • @refinedev/core: 4.54.1
  • @refinedev/devtools: 1.2.8
  • @refinedev/react-router-v6: 4.6.0
  • @refinedev/simple-rest: 5.0.8

Additional Context

No response

@alicanerdurmaz alicanerdurmaz added the bug Something isn't working label Sep 18, 2024
@alicanerdurmaz alicanerdurmaz self-assigned this Sep 18, 2024
@BatuhanW BatuhanW added this to the October Release milestone Sep 19, 2024
aliemir pushed a commit that referenced this issue Sep 23, 2024
@BatuhanW BatuhanW linked a pull request Oct 14, 2024 that will close this issue
@aliemir aliemir linked a pull request Oct 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment