Skip to content

[Bug]: Invalid prop renderIcon warning in console for menuItemSelectable #14521

Closed

Description

Package

@carbon/react

Browser

Chrome

Package version

V1.36

React version

v18.2

Description

When trying to render MenuItemSelectable Component inside a Menu component, i get the following warning:

Warning: Failed prop type: Invalid prop `renderIcon` supplied to `ForwardRef(MenuItem)`, expected one of type [function, object].
    at MenuItem (https://6r3y3j.csb.app/node_modules/@carbon/react/es/components/Menu/MenuItem.js:42:23)
    at MenuItemSelectable (https://6r3y3j.csb.app/node_modules/@carbon/react/es/components/Menu/MenuItem.js:209:25)
    at ul
    at li
    at MenuItemGroup (https://6r3y3j.csb.app/node_modules/@carbon/react/es/components/Menu/MenuItem.js:273:24)
    at ul
    at Menu (https://6r3y3j.csb.app/node_modules/@carbon/react/es/components/Menu/Menu.js:28:18)
    at div
    at App

Reproduction/example

https://codesandbox.io/s/romantic-ace-6r3y3j?file=/index.js:240-244

Steps to reproduce

  • Place MenuItemSelectable inside a Menu component
  • Open the console to see the warning

Suggested Severity

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

Application/PAL

No response

Code of Conduct

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

Metadata

Type

No type

Projects

  • Status

    ✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions