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]: Console Warning: Invalid prop kind of value danger--tertiary supplied to ForwardRef(IconButton2), despite documentation support Button component and base code including "danger--tertiary" in the kind props array. #18253

Open
1 of 2 tasks
SantoshV01 opened this issue Dec 13, 2024 · 0 comments

Comments

@SantoshV01
Copy link

SantoshV01 commented Dec 13, 2024

Package

@carbon/react

Browser

Chrome, Safari

Package version

v1.72.0

React version

v18.3.1

Description

A console warning appears indicating a failed prop type validation for the kind prop in the Button component.
The warning states: Warning: Failed prop type: Invalid prop kind of value danger--tertiary supplied to ForwardRef(IconButton2), expected one of ["primary","secondary","ghost","tertiary"].

However, the UI and functionality are unaffected; the Button component renders correctly with the specified kind value (danger--tertiary). Additionally, the component documentation explicitly lists danger--tertiary as a valid value for the kind prop.

Expected Behavior:
No warning should appear in the console if the kind prop value is valid per the documentation.

Actual Behavior:
A warning appears in the console, indicating a prop validation failure, despite the value being documented and the component rendering as expected.

Impact:

The warning could confuse developers and lead to unnecessary debugging efforts.
No functional or UI impact is observed.
Potential Cause:

Mismatch between the documentation and the actual prop validation logic implemented in the component.

Reproduction/example

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

Steps to reproduce

  1. Use the following code:

       import { Button } from '@carbon/react';
       import { ThumbsUp } from '@carbon/react/icons';
       
       export default function App() {
         return (
           <div>
             <Button
               size="lg"
               renderIcon={() => <ThumbsUp />}
               hasIconOnly
               kind="danger--tertiary"
               iconDescription="Helpful"
             />
           </div>
         );
       }
    
  2. Open the browser console to observe the warning message.

Suggested Severity

Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.

Application/PAL

Third Party Dashboard

Code of Conduct

@SantoshV01 SantoshV01 changed the title [Bug]: Console Warning: Invalid prop kind of value danger--tertiary supplied to ForwardRef(IconButton2), despite documentation support and base code including "danger--tertiary" in the kind props array. [Bug]: Console Warning: Invalid prop kind of value danger--tertiary supplied to ForwardRef(IconButton2), despite documentation support Button components and base code including "danger--tertiary" in the kind props array. Dec 13, 2024
@SantoshV01 SantoshV01 changed the title [Bug]: Console Warning: Invalid prop kind of value danger--tertiary supplied to ForwardRef(IconButton2), despite documentation support Button components and base code including "danger--tertiary" in the kind props array. [Bug]: Console Warning: Invalid prop kind of value danger--tertiary supplied to ForwardRef(IconButton2), despite documentation support Button component and base code including "danger--tertiary" in the kind props array. Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant