mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +08:00
fix: Menu not support React.Fragment (#26656)
* fix: Menu support React.Fragment * chore: tweak menu demo * fix: React key warning
This commit is contained in:
parent
d98981b279
commit
39b40b573d
@ -24,6 +24,26 @@ describe('Menu', () => {
|
||||
</Menu>
|
||||
));
|
||||
|
||||
mountTest(() => (
|
||||
<Menu>
|
||||
<Menu.Item />
|
||||
<>
|
||||
<Menu.ItemGroup />
|
||||
<Menu.SubMenu />
|
||||
{null}
|
||||
</>
|
||||
<>
|
||||
<Menu.Item />
|
||||
</>
|
||||
{undefined}
|
||||
<>
|
||||
<>
|
||||
<Menu.Item />
|
||||
</>
|
||||
</>
|
||||
</Menu>
|
||||
));
|
||||
|
||||
rtlTest(() => (
|
||||
<Menu>
|
||||
<Menu.Item />
|
||||
|
@ -39,7 +39,7 @@ class App extends React.Component {
|
||||
<Menu.Item key="app" disabled icon={<AppstoreOutlined />}>
|
||||
Navigation Two
|
||||
</Menu.Item>
|
||||
<SubMenu icon={<SettingOutlined />} title="Navigation Three - Submenu">
|
||||
<SubMenu key="SubMenu" icon={<SettingOutlined />} title="Navigation Three - Submenu">
|
||||
<Menu.ItemGroup title="Item 1">
|
||||
<Menu.Item key="setting:1">Option 1</Menu.Item>
|
||||
<Menu.Item key="setting:2">Option 2</Menu.Item>
|
||||
|
@ -34,21 +34,22 @@ function renderFilterItems({
|
||||
locale: TableLocale;
|
||||
}) {
|
||||
if (filters.length === 0) {
|
||||
// wrapped with <></> to avoid react warning
|
||||
// wrapped with <div /> to avoid react warning
|
||||
// https://github.com/ant-design/ant-design/issues/25979
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
style={{
|
||||
margin: '16px 0',
|
||||
}}
|
||||
>
|
||||
<Empty
|
||||
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
||||
description={locale.filterEmptyText}
|
||||
style={{
|
||||
margin: '16px 0',
|
||||
}}
|
||||
imageStyle={{
|
||||
height: 24,
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return filters.map((filter, index) => {
|
||||
|
@ -128,7 +128,7 @@
|
||||
"rc-image": "~3.0.6",
|
||||
"rc-input-number": "~6.0.0",
|
||||
"rc-mentions": "~1.4.0",
|
||||
"rc-menu": "~8.5.2",
|
||||
"rc-menu": "~8.6.1",
|
||||
"rc-motion": "^2.0.0",
|
||||
"rc-notification": "~4.4.0",
|
||||
"rc-pagination": "~3.0.3",
|
||||
|
Loading…
Reference in New Issue
Block a user