Skip to content

Commit 7160fd2

Browse files
committed
chore: not patch warnKey prop in dom
1 parent 2f05bd7 commit 7160fd2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/MenuItem.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ const InternalMenuItem = (props: MenuItemProps) => {
7878
className,
7979

8080
eventKey,
81+
warnKey,
8182
disabled,
8283
itemIcon,
8384
children,
@@ -124,7 +125,7 @@ const InternalMenuItem = (props: MenuItemProps) => {
124125
const connectedKeys = useFullPath(eventKey);
125126

126127
// ================================ Warn ================================
127-
if (process.env.NODE_ENV !== 'production' && props.warnKey) {
128+
if (process.env.NODE_ENV !== 'production' && warnKey) {
128129
warning(false, 'MenuItem should not leave undefined `key`.');
129130
}
130131

src/SubMenu/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const InternalSubMenu = (props: SubMenuProps) => {
7373

7474
title,
7575
eventKey,
76+
warnKey,
7677

7778
disabled,
7879
internalPopupClose,
@@ -135,7 +136,7 @@ const InternalSubMenu = (props: SubMenuProps) => {
135136
const popupRef = React.useRef<HTMLUListElement>();
136137

137138
// ================================ Warn ================================
138-
if (process.env.NODE_ENV !== 'production' && props.warnKey) {
139+
if (process.env.NODE_ENV !== 'production' && warnKey) {
139140
warning(false, 'SubMenu should not leave undefined `key`.');
140141
}
141142

0 commit comments

Comments
 (0)