react-live-data-table 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-live-data-table",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "Your React component package with Tailwind",
5
5
  "main": "src/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -159,9 +159,14 @@ function ReactDataTable({
159
159
  }
160
160
  };
161
161
 
162
+ // This is the problem area - it was causing an infinite loop
162
163
  useEffect(() => {
163
- handleScroll(tableContainerRef.current);
164
- }, [data]);
164
+ const containerElement = tableContainerRef.current;
165
+ if (containerElement && !staticData) {
166
+ handleScroll(containerElement);
167
+ }
168
+ // Don't include 'data' as a dependency here
169
+ }, [pageParam, isFetching]); // Only depend on pageParam and isFetching
165
170
 
166
171
  const flatData = data.pages.flatMap(page => page.data);
167
172
 
@@ -282,7 +287,6 @@ function ReactDataTable({
282
287
  >
283
288
  {enhancedColumns.map(column => (
284
289
  <td
285
-
286
290
  key={column.accessorKey || column.id}
287
291
  className={`text-left font-normal border-r ${column?.cellProps?.className || ''}`}
288
292
  style={{