mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-15 07:54:18 +02:00
remove memoization from individual table columns
- causes issues with drag/drop state
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { memo } from 'react';
|
||||
|
||||
import {
|
||||
ColumnNullFallback,
|
||||
ColumnSkeletonFixed,
|
||||
@@ -7,7 +5,7 @@ import {
|
||||
TableColumnTextContainer,
|
||||
} from '/@/renderer/components/item-list/item-table-list/item-table-list-column';
|
||||
|
||||
const DefaultColumnBase = (props: ItemTableListInnerColumn) => {
|
||||
export const DefaultColumn = (props: ItemTableListInnerColumn) => {
|
||||
const rowItem = props.getRowItem?.(props.rowIndex) ?? (props.data as any[])[props.rowIndex];
|
||||
const row: any | undefined = (rowItem as any)?.[props.columns[props.columnIndex].id];
|
||||
|
||||
@@ -21,12 +19,3 @@ const DefaultColumnBase = (props: ItemTableListInnerColumn) => {
|
||||
|
||||
return <ColumnSkeletonFixed {...props} />;
|
||||
};
|
||||
|
||||
export const DefaultColumn = memo(DefaultColumnBase, (prevProps, nextProps) => {
|
||||
return (
|
||||
prevProps.rowIndex === nextProps.rowIndex &&
|
||||
prevProps.columnIndex === nextProps.columnIndex &&
|
||||
prevProps.data === nextProps.data &&
|
||||
prevProps.columns === nextProps.columns
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user