@@ -82,7 +82,7 @@ const addIndicators = ({ children, lastVisibleIndex, prefix, renderMore }) => {
82
82
return arr ;
83
83
} ;
84
84
85
- const getNewChildren = ( { children, root, lastVisibleIndex, hozInLine, prefix, renderMore } ) => {
85
+ const getNewChildren = ( { children, root, mode , lastVisibleIndex, hozInLine, prefix, renderMore } ) => {
86
86
const k2n = { } ;
87
87
const p2n = { } ;
88
88
@@ -144,7 +144,7 @@ const getNewChildren = ({ children, root, lastVisibleIndex, hozInLine, prefix, r
144
144
// parent know children's inlineLevel
145
145
// if parent's mode is popup, then children's inlineLevel must be 1;
146
146
// else inlineLevel should add 1
147
- const childLevel = ( child . props . mode || props . root . props . mode ) === 'popup' ? 1 : inlineLevel + 1 ;
147
+ const childLevel = ( child . props . mode || mode ) === 'popup' ? 1 : inlineLevel + 1 ;
148
148
149
149
switch ( child . type . menuChildType ) {
150
150
case 'submenu' :
@@ -400,10 +400,7 @@ class Menu extends Component {
400
400
401
401
const { newChildren, _k2n, _p2n } = getNewChildren ( {
402
402
root : this ,
403
- hozInLine,
404
- prefix,
405
- children,
406
- renderMore,
403
+ ...this . props ,
407
404
} ) ;
408
405
409
406
const tabbableKey = focusable ? getFirstAvaliablelChildKey ( '0' , _p2n ) : undefined ;
@@ -445,14 +442,10 @@ class Menu extends Component {
445
442
state . focusedKey = nextProps . focusedKey ;
446
443
}
447
444
448
- const { hozInLine, children, prefix, renderMore } = nextProps ;
449
445
const { newChildren, _k2n, _p2n } = getNewChildren ( {
450
446
root : prevState . root ,
451
- hozInLine,
452
447
lastVisibleIndex : prevState . lastVisibleIndex ,
453
- prefix,
454
- children,
455
- renderMore,
448
+ ...nextProps ,
456
449
} ) ;
457
450
458
451
state . newChildren = newChildren ;
@@ -592,15 +585,11 @@ class Menu extends Component {
592
585
593
586
getUpdateChildren = ( ) => {
594
587
const { root, lastVisibleIndex } = this . state ;
595
- const { prefix, hozInLine, children, renderMore } = this . props ;
596
588
597
589
return getNewChildren ( {
598
590
root,
599
- hozInLine,
600
591
lastVisibleIndex,
601
- prefix,
602
- children,
603
- renderMore,
592
+ ...this . props ,
604
593
} ) ;
605
594
} ;
606
595
0 commit comments