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]: ToolbarMenuListItem.tsx is missing __suppressDeprecationWarning for <Icons> #29149

Open
morcosan opened this issue Sep 18, 2024 · 0 comments

Comments

@morcosan
Copy link

Describe the bug

This line of code:
const Icon = icon && <Icons style={{ opacity: 1 }} icon={icon} />;

Should have been:
const Icon = icon && <Icons style={{ opacity: 1 }} icon={icon} __suppressDeprecationWarning={true} />;

Like in ToolbarMenuButton.tsx:
{icon && <Icons icon={icon} __suppressDeprecationWarning={true} />}

Otherwise I get a very annoying warning in my console, like this:

image

Reproduction link

https://github.com/storybookjs/storybook/blob/next/code/addons/toolbars/src/components/ToolbarMenuListItem.tsx

Reproduction steps

Go to this file: https://github.com/storybookjs/storybook/blob/next/code/addons/toolbars/src/components/ToolbarMenuButton.tsx

Read the comment:

// We can't remove the Icons component just yet because there's no way for now to import icons
// in the preview directly. Before having a better solution, we are going to keep the Icons component
// for now and remove the deprecated warning.

Read the code:

{icon && <Icons icon={icon} __suppressDeprecationWarning={true} />}

Go to this file:
https://github.com/storybookjs/storybook/blob/next/code/addons/toolbars/src/components/ToolbarMenuListItem.tsx

There is no comment to read.
And the code is:

const Icon = icon && <Icons style={{ opacity: 1 }} icon={icon} />;

It's missing the __suppressDeprecationWarning.

System

Storybook Environment Info:

  System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 13th Gen Intel(R) Core(TM) i7-1360P
  Binaries:
    Node: 20.13.1 - C:\Program Files\nodejs\node.EXE
    npm: 10.8.3 - C:\Program Files\nodejs\npm.CMD <----- active
  Browsers:
    Edge: Chromium (127.0.2651.74)
  npmPackages:
    @storybook/addon-a11y: ^8.3.1 => 8.3.1
    @storybook/addon-essentials: ^8.3.1 => 8.3.1
    @storybook/addon-toolbars: ^8.3.1 => 8.3.1
    @storybook/react-vite: ^8.3.1 => 8.3.1
    @storybook/theming: ^8.3.0 => 8.3.1
    storybook: ^8.3.0 => 8.3.1

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant