Skip to content

Commit fc7d9c4

Browse files
Yuiai01dujiaqi
andauthored
fix: filter part props (#606)
Co-authored-by: dujiaqi <[email protected]>
1 parent 71af4b1 commit fc7d9c4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/MenuItem.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ export interface MenuItemProps
3838
class LegacyMenuItem extends React.Component<any> {
3939
render() {
4040
const { title, attribute, elementRef, ...restProps } = this.props;
41-
42-
const passedProps = omit(restProps, ['eventKey']);
41+
42+
// Here the props are eventually passed to the DOM element.
43+
// React does not recognize non-standard attributes.
44+
// Therefore, remove the props that is not used here.
45+
// ref: https://github.com/ant-design/ant-design/issues/41395
46+
const passedProps = omit(restProps, ['eventKey', 'popupClassName', 'popupOffset', 'onTitleClick']);
4347
warning(
4448
!attribute,
4549
'`attribute` of Menu.Item is deprecated. Please pass attribute directly.',

0 commit comments

Comments
 (0)