@@ -23,7 +23,7 @@ const BodyLine = React.forwardRef<HTMLDivElement, BodyLineProps>((props, ref) =>
23
23
const { data, index, className, rowKey, style, extra, getHeight, ...restProps } = props ;
24
24
const { record, indent } = data ;
25
25
26
- const { flattenColumns, prefixCls, expandableType , rowExpandable } = useContext ( TableContext , [
26
+ const { flattenColumns, prefixCls } = useContext ( TableContext , [
27
27
'prefixCls' ,
28
28
'flattenColumns' ,
29
29
'expandableType' ,
@@ -34,6 +34,12 @@ const BodyLine = React.forwardRef<HTMLDivElement, BodyLineProps>((props, ref) =>
34
34
const rowInfo = useRowInfo ( record , rowKey ) ;
35
35
36
36
// ========================== Expand ==========================
37
+ const { expandable, expanded } = rowInfo ;
38
+
39
+ let expandRowNode : React . ReactElement ;
40
+ if ( expandable && expanded ) {
41
+ expandRowNode = < > 233</ > ;
42
+ }
37
43
38
44
// ========================== Render ==========================
39
45
@@ -47,10 +53,10 @@ const BodyLine = React.forwardRef<HTMLDivElement, BodyLineProps>((props, ref) =>
47
53
rowStyle . pointerEvents = 'none' ;
48
54
}
49
55
50
- return (
56
+ const rowNode = (
51
57
< div
52
58
{ ...restProps }
53
- ref = { ref }
59
+ ref = { expandable ? null : ref }
54
60
className = { classNames ( className , `${ prefixCls } -row` , {
55
61
[ `${ prefixCls } -row-extra` ] : extra ,
56
62
} ) }
@@ -73,6 +79,17 @@ const BodyLine = React.forwardRef<HTMLDivElement, BodyLineProps>((props, ref) =>
73
79
} ) }
74
80
</ div >
75
81
) ;
82
+
83
+ if ( expandable ) {
84
+ return (
85
+ < div ref = { ref } >
86
+ { rowNode }
87
+ { expandRowNode }
88
+ </ div >
89
+ ) ;
90
+ }
91
+
92
+ return rowNode ;
76
93
} ) ;
77
94
78
95
const ResponseBodyLine = responseImmutable ( BodyLine ) ;
0 commit comments