From 179f69dfcaa232600157e8602412eb6a8a744732 Mon Sep 17 00:00:00 2001 From: RedwindA Date: Mon, 15 Jun 2026 21:11:46 +0800 Subject: [PATCH] fix(data-table): compare column class callback --- .../src/components/data-table/core/data-table-row.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/web/default/src/components/data-table/core/data-table-row.tsx b/web/default/src/components/data-table/core/data-table-row.tsx index 23e08052..0730380e 100644 --- a/web/default/src/components/data-table/core/data-table-row.tsx +++ b/web/default/src/components/data-table/core/data-table-row.tsx @@ -62,14 +62,12 @@ function DataTableRowInner({ } const MemoizedDataTableRow = React.memo(DataTableRowInner, (prev, next) => { - // Skip re-render when only the getColumnClassName reference changed but the - // row identity and captured selection state are the same. Callers rarely - // stabilize this callback, so excluding it from comparison avoids unnecessary - // renders. Do not read row.getIsSelected() here: TanStack row objects may keep - // a stable reference while their selection state changes. + // Do not read row.getIsSelected() here: TanStack row objects may keep a stable + // reference while their selection state changes. return ( prev.row === next.row && prev.className === next.className && + prev.getColumnClassName === next.getColumnClassName && prev.isSelected === next.isSelected ) }) as typeof DataTableRowInner