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 +1 -1
- package/src/ReactDataTable.jsx +7 -3
package/package.json
CHANGED
package/src/ReactDataTable.jsx
CHANGED
@@ -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
|
-
|
164
|
-
|
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={{
|