File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ const Row: FunctionalComponent<RowProps> = props => {
50
50
if ( typeof component === 'string' ) {
51
51
return (
52
52
< Cell
53
- key = { `${ type } -${ key || index } ` }
53
+ key = { `${ type } -${ String ( key ) || index } ` }
54
54
class = { className }
55
55
style = { style }
56
56
labelStyle = { { ...rootLabelStyle . value , ...labelStyle } }
@@ -68,7 +68,7 @@ const Row: FunctionalComponent<RowProps> = props => {
68
68
69
69
return [
70
70
< Cell
71
- key = { `label-${ key || index } ` }
71
+ key = { `label-${ String ( key ) || index } ` }
72
72
class = { className }
73
73
style = { { ...rootLabelStyle . value , ...style , ...labelStyle } }
74
74
span = { 1 }
@@ -79,7 +79,7 @@ const Row: FunctionalComponent<RowProps> = props => {
79
79
label = { label }
80
80
/> ,
81
81
< Cell
82
- key = { `content-${ key || index } ` }
82
+ key = { `content-${ String ( key ) || index } ` }
83
83
class = { className }
84
84
style = { { ...rootContentStyle . value , ...style , ...contentStyle } }
85
85
span = { span * 2 - 1 }
Original file line number Diff line number Diff line change @@ -7,16 +7,17 @@ function convertNodeToOption(node: VNode): OptionData {
7
7
key,
8
8
children,
9
9
props : { value, disabled, ...restProps } ,
10
- } = node as VNode & {
10
+ } = node as Omit < VNode , 'key' > & {
11
11
children : { default ?: ( ) => any } ;
12
+ key : string | number ;
12
13
} ;
13
14
const child = children && children . default ? children . default ( ) : undefined ;
14
15
return {
15
16
key,
16
17
value : value !== undefined ? value : key ,
17
18
children : child ,
18
19
disabled : disabled || disabled === '' , // support <a-select-option disabled />
19
- ...restProps ,
20
+ ...( restProps as Omit < typeof restProps , 'key' > ) ,
20
21
} ;
21
22
}
22
23
@@ -46,7 +47,7 @@ export function convertChildrenToData(
46
47
const child = children && children . default ? children . default ( ) : undefined ;
47
48
const label = props ?. label || children . label ?.( ) || key ;
48
49
return {
49
- key : `__RC_SELECT_GRP__${ key === null ? index : key } __` ,
50
+ key : `__RC_SELECT_GRP__${ key === null ? index : String ( key ) } __` ,
50
51
...props ,
51
52
label,
52
53
options : convertChildrenToData ( child || [ ] ) ,
You can’t perform that action at this time.
0 commit comments