question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using Cascader as menu item label is not working

See original GitHub issue

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Created a custom component for cascader which takes menu item name/lable as a prop Add that component in the menu item list for the key label

What is expected?

when I hover over the menu item or click on the menu item, I should see a cascader component

What is actually happening?

Gettign the below error

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it’s defined in, or you might have mixed up default and named imports. Check the render method of Trigger2.

Environment Info
antd 5.0.6
React 18.2.0
System Windows 10
Browser Chrome

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
afc163commented, Dec 19, 2022

However, it is a bad practice to use Cascader in a Menu Item. Don’t try it.

1reaction
afc163commented, Dec 19, 2022
<Cascader options={options} onChange={onChange}>
  <span>Navigation One</span>
</Cascader>

https://codesandbox.io/s/top-navigation-antd-5-0-7-forked-6dg3o9?file=/demo.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

Non-cascade type menubar items not working on Tkinter ...
I've come across what I think may be a bug where whenever I try to make a menubar ( Menu ) in tkinter...
Read more >
Cascader
When selecting from a large data set, with multi-stage classification separated for easy selection. Chooses cascade items in one float layer for better...
Read more >
TkDocs Tutorial - Menus
Both have a label option to specify the text to display for the item. Submenus. We've already seen cascade menu items used to...
Read more >
60704 – Long menu item labels cut off
Bug 60704 - Long menu item labels cut off ... It's SWT. We have a work around for this bug in Windows that...
Read more >
Don`t show the window menu
Gomez, In the Object Navigator, go to the 'Property pallette' for the form. Under the 'Functional' section there is a property called 'Menu...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found