11import * as React from 'react' ;
22import classNames from 'classnames' ;
3- import ResizeObserver from 'rc-resize-observer' ;
43import Cell from '../Cell' ;
54import TableContext from '../context/TableContext' ;
65import BodyContext from '../context/BodyContext' ;
@@ -13,7 +12,6 @@ import {
1312 Key ,
1413 GetRowKey ,
1514} from '../interface' ;
16- import ResizeContext from '../context/ResizeContext' ;
1715import { getCellFixedInfo } from '../utils/fixUtil' ;
1816import ExpandedRow from './ExpandedRow' ;
1917
@@ -22,8 +20,6 @@ export interface BodyRowProps<RecordType> {
2220 index : number ;
2321 className ?: string ;
2422 style ?: React . CSSProperties ;
25- /** Set if need collect column width info */
26- measureColumnWidth : boolean ;
2723 stickyOffsets : StickyOffsets ;
2824 recordKey : Key ;
2925 expandedKeys : Set < Key > ;
@@ -51,7 +47,6 @@ function BodyRow<RecordType extends { children?: RecordType[] }>(props: BodyRowP
5147 indent = 0 ,
5248 rowComponent : RowComponent ,
5349 cellComponent,
54- measureColumnWidth,
5550 childrenColumnName,
5651 } = props ;
5752 const { prefixCls } = React . useContext ( TableContext ) ;
@@ -70,7 +65,6 @@ function BodyRow<RecordType extends { children?: RecordType[] }>(props: BodyRowP
7065 expandedRowRender,
7166 expandIconColumnIndex,
7267 } = React . useContext ( BodyContext ) ;
73- const { onColumnResize } = React . useContext ( ResizeContext ) ;
7468 const [ expandRended , setExpandRended ] = React . useState ( false ) ;
7569
7670 const expanded = props . expandedKeys . has ( props . recordKey ) ;
@@ -165,7 +159,7 @@ function BodyRow<RecordType extends { children?: RecordType[] }>(props: BodyRowP
165159 additionalCellProps = column . onCell ( record , index ) ;
166160 }
167161
168- const cellNode = (
162+ return (
169163 < Cell
170164 className = { columnClassName }
171165 ellipsis = { column . ellipsis }
@@ -182,21 +176,6 @@ function BodyRow<RecordType extends { children?: RecordType[] }>(props: BodyRowP
182176 additionalProps = { additionalCellProps }
183177 />
184178 ) ;
185-
186- if ( measureColumnWidth ) {
187- return (
188- < ResizeObserver
189- key = { key }
190- onResize = { ( { width } ) => {
191- onColumnResize ( key , width ) ;
192- } }
193- >
194- { cellNode }
195- </ ResizeObserver >
196- ) ;
197- }
198-
199- return cellNode ;
200179 } ) }
201180 </ RowComponent >
202181 ) ;
@@ -243,7 +222,6 @@ function BodyRow<RecordType extends { children?: RecordType[] }>(props: BodyRowP
243222 recordKey = { subKey }
244223 index = { subIndex }
245224 indent = { indent + 1 }
246- measureColumnWidth = { false }
247225 />
248226 ) ;
249227 } ,
0 commit comments