@sustaina/shared-ui 1.21.0 → 1.21.1

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/dist/index.js CHANGED
@@ -4396,9 +4396,6 @@ var DataTable = ({
4396
4396
  columnResizeMode: columnResizing?.enabled ? columnResizing?.resizeMode ?? "onChange" : "onChange"
4397
4397
  })
4398
4398
  });
4399
- if (isDefined(tableRef) && !isDefined(tableRef?.current)) {
4400
- tableRef.current = table;
4401
- }
4402
4399
  const tableContainerRef = React4.useRef(null);
4403
4400
  const isTableEmpty = table.getCoreRowModel().rows.length === 0;
4404
4401
  const isTableEmptyAfterFiltering = table.getRowModel().rows.length === 0;
@@ -4476,6 +4473,13 @@ var DataTable = ({
4476
4473
  // eslint-disable-next-line react-hooks/exhaustive-deps
4477
4474
  [scrollFetch?.enabled, scrollFetch?.isFetchingMore, scrollFetch?.hasMore, scrollFetch?.fetchMore]
4478
4475
  );
4476
+ React4.useEffect(() => {
4477
+ if (!tableRef) return;
4478
+ tableRef.current = table;
4479
+ return () => {
4480
+ tableRef.current = null;
4481
+ };
4482
+ }, [tableRef, table]);
4479
4483
  React4.useEffect(() => {
4480
4484
  fetchMoreOnScrollReached(tableContainerRef.current);
4481
4485
  }, [fetchMoreOnScrollReached]);