Skip to content

Commit

Permalink
fix: Not warning key missing for Menu.Group
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Jun 7, 2021
1 parent d41b3c3 commit 23740fe
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/MenuItemGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import classNames from 'classnames';
import omit from 'rc-util/lib/omit';
import { parseChildren } from './utils/nodeUtil';
import { MenuContext } from './context/MenuContext';
import { useFullPath, useMeasure } from './context/PathContext';
Expand All @@ -11,6 +12,9 @@ export interface MenuItemGroupProps {

/** @private Internal filled key. Do not set it directly */
eventKey?: string;

/** @private Do not use. Private warning empty usage */
warnKey?: boolean;
}

const InternalMenuItemGroup = ({
Expand Down Expand Up @@ -53,8 +57,12 @@ export default function MenuItemGroup({

const measure = useMeasure();
if (measure) {
return (childList as any) as React.ReactElement;
return childList as any as React.ReactElement;
}

return <InternalMenuItemGroup {...props}>{childList}</InternalMenuItemGroup>;
return (
<InternalMenuItemGroup {...omit(props, ['warnKey'])}>
{childList}
</InternalMenuItemGroup>
);
}

0 comments on commit 23740fe

Please sign in to comment.