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]: IconButton with danger kind #11892

Closed
2 tasks done
stanley-regnard opened this issue Aug 1, 2022 · 0 comments
Closed
2 tasks done

[Bug]: IconButton with danger kind #11892

stanley-regnard opened this issue Aug 1, 2022 · 0 comments

Comments

@stanley-regnard
Copy link
Contributor

Package

@carbon/react

Browser

Chrome

Package version

1.8.0

React version

18.2.0

Description

The following code:

...
<Button
    hasIconOnly
    className={canDelete === false ? "hidden" : ""}
    disabled={canDelete === false}
    iconDescription={txt.DELETE}
    kind="danger--ghost"
    onClick={() => onDelete(index)}
    renderIcon={DeleteIcon}
    size="sm"
/>
...

Outputs the following warning in the console:

Warning: Failed prop type: Invalid prop `kind` of value `danger--ghost` supplied to `ForwardRef(IconButton2)`,
expected one of ["primary","secondary","ghost","tertiary"].

Displays and functions as intended otherwise.

Reproduction/example

https://stackblitz.com/edit/github-mddqrk?file=src%2FApp.jsx

Steps to reproduce

Using Chrome, click the link to the example and open the developer tools console.
You should see the following warning:

Warning: Failed prop type: Invalid prop `kind` of value `danger--ghost` supplied to `ForwardRef(IconButton2)`,
expected one of ["primary","secondary","ghost","tertiary"].

Displays and functions as intended otherwise.

Code of Conduct

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

Successfully merging a pull request may close this issue.

1 participant