@@ -13,7 +13,6 @@ import type {
1313 PaginatedTableData ,
1414 RenderEmptyDataMessage ,
1515 RenderErrorMessage ,
16- SortParams ,
1716} from './types' ;
1817import { useScrollBasedChunks } from './useScrollBasedChunks' ;
1918
@@ -29,7 +28,6 @@ export interface PaginatedTableProps<T, F> {
2928 getRowClassName ?: GetRowClassName < T > ;
3029 rowHeight ?: number ;
3130 scrollContainerRef : React . RefObject < HTMLElement > ;
32- initialSortParams ?: SortParams ;
3331 onColumnsResize ?: HandleTableColumnsResize ;
3432 renderEmptyDataMessage ?: RenderEmptyDataMessage ;
3533 renderErrorMessage ?: RenderErrorMessage ;
@@ -50,7 +48,6 @@ export const PaginatedTable = <T, F>({
5048 getRowClassName,
5149 rowHeight = DEFAULT_TABLE_ROW_HEIGHT ,
5250 scrollContainerRef,
53- initialSortParams,
5451 onColumnsResize,
5552 renderErrorMessage,
5653 renderEmptyDataMessage,
@@ -64,24 +61,6 @@ export const PaginatedTable = <T, F>({
6461
6562 const { sortParams, foundEntities} = tableState ;
6663
67- // Initialize state with props if available
68- React . useEffect ( ( ) => {
69- if ( initialSortParams ) {
70- setSortParams ( initialSortParams ) ;
71- }
72-
73- if ( initialEntitiesCount ) {
74- setTotalEntities ( initialEntitiesCount ) ;
75- setFoundEntities ( initialEntitiesCount ) ;
76- }
77- } , [
78- setSortParams ,
79- setTotalEntities ,
80- setFoundEntities ,
81- initialSortParams ,
82- initialEntitiesCount ,
83- ] ) ;
84-
8564 const tableRef = React . useRef < HTMLDivElement > ( null ) ;
8665
8766 const activeChunks = useScrollBasedChunks ( {
@@ -120,7 +99,7 @@ export const PaginatedTable = <T, F>({
12099 [ onDataFetched , setFoundEntities , setIsInitialLoad , setTotalEntities ] ,
121100 ) ;
122101
123- // Reset table on filters change
102+ // Reset table on initialization and filters change
124103 React . useLayoutEffect ( ( ) => {
125104 const defaultTotal = initialEntitiesCount || 0 ;
126105 const defaultFound = initialEntitiesCount || 1 ;
0 commit comments