We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This question does not require ‘Reproduction link’, so this link is invalid.
When dynamically constructing menu.item, three states,
const tableData = [ { name: 'item 1', status: 0 }, { name: 'item 2', status: 1 }, { name: 'item 3', status: 2 } ] const status = [ { key: 0, text: "action a" }, { key: 1, text: "action b" } ] function MenuItem() { return ( tableData.forEach((dataItem) => { status.some((statusItem) => { if (dataItem.status === statusItem.key) { if (statusItem.key === 0) { return <Menu.Item key="action a">action a</Menu.Item>; } else if (statusItem.key === 1) { return <Menu.Item key="action b">action b</Menu.Item>; } else { // This condition is currently not supported return <> <Menu.Item key="action a">action a</Menu.Item> <Menu.Item key="action b">action b</Menu.Item> </>; } return true; } }); }); ) }
Menu.Item support React 'Fragments'
Menu.Item renders the list ClassName is undefined-item, instead of the expected 'ant-menu-item'.
undefined-item
The text was updated successfully, but these errors were encountered:
try this
return [ <Menu.Item key="action a">action a</Menu.Item>, <Menu.Item key="action b">action b</Menu.Item> ];
Sorry, something went wrong.
class name: ant-menu-item ant-menu-item
ant-menu-item ant-menu-item
yesmeck
Successfully merging a pull request may close this issue.
Reproduction link
This question does not require ‘Reproduction link’, so this link is invalid.
Steps to reproduce
When dynamically constructing menu.item, three states,
What is expected?
Menu.Item support React 'Fragments'
What is actually happening?
Menu.Item renders the list ClassName is
undefined-item
, instead of the expected 'ant-menu-item'.This question does not require ‘Reproduction link’, so this link is invalid.
The text was updated successfully, but these errors were encountered: