fix(data-table): compare column class callback

This commit is contained in:
RedwindA
2026-06-15 21:11:46 +08:00
parent 8477f6288b
commit 179f69dfca
@@ -62,14 +62,12 @@ function DataTableRowInner<TData>({
}
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