@@ -176,7 +176,6 @@ const AnalyticalTable: FC<TableProps> = forwardRef((props: TableProps, ref: Ref<
176
176
177
177
const [ analyticalTableRef , reactWindowRef ] = useTableScrollHandles ( ref ) ;
178
178
const tableRef : RefObject < HTMLDivElement > = useRef ( ) ;
179
- const resizeObserverInitialized = useRef ( false ) ;
180
179
const extension = useDeprecateRenderMethods ( props , 'renderExtension' , 'extension' ) ;
181
180
182
181
const getSubRows = useCallback ( ( row ) => row [ subRowsKey ] || [ ] , [ subRowsKey ] ) ;
@@ -258,21 +257,16 @@ const AnalyticalTable: FC<TableProps> = forwardRef((props: TableProps, ref: Ref<
258
257
259
258
useEffect ( ( ) => {
260
259
// @ts -ignore
261
- const tableWidthObserver = new ResizeObserver ( ( ) => {
262
- if ( resizeObserverInitialized . current ) {
263
- updateTableClientWidth ( ) ;
264
- }
265
- resizeObserverInitialized . current = true ;
266
- } ) ;
260
+ const tableWidthObserver = new ResizeObserver ( updateTableClientWidth ) ;
267
261
tableWidthObserver . observe ( tableRef . current ) ;
268
262
return ( ) => {
269
263
tableWidthObserver . disconnect ( ) ;
270
264
} ;
271
- } , [ updateTableClientWidth , resizeObserverInitialized ] ) ;
265
+ } , [ updateTableClientWidth ] ) ;
272
266
273
267
useEffect ( ( ) => {
274
268
updateTableClientWidth ( ) ;
275
- } , [ ] ) ;
269
+ } , [ updateTableClientWidth ] ) ;
276
270
277
271
useEffect ( ( ) => {
278
272
dispatch ( { type : 'SET_GROUP_BY' , payload : groupBy } ) ;
0 commit comments