mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-19 01:44:00 +02:00
add more memoization to the ItemTableList
This commit is contained in:
@@ -18,7 +18,7 @@ import { Text } from '/@/shared/components/text/text';
|
||||
import { LibraryItem, QueueSong } from '/@/shared/types/domain-types';
|
||||
import { PlayerStatus } from '/@/shared/types/types';
|
||||
|
||||
export const RowIndexColumn = (props: ItemTableListInnerColumn) => {
|
||||
const RowIndexColumnBase = (props: ItemTableListInnerColumn) => {
|
||||
const { itemType } = props;
|
||||
|
||||
switch (itemType) {
|
||||
@@ -32,6 +32,19 @@ export const RowIndexColumn = (props: ItemTableListInnerColumn) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const RowIndexColumn = memo(RowIndexColumnBase, (prevProps, nextProps) => {
|
||||
return (
|
||||
prevProps.rowIndex === nextProps.rowIndex &&
|
||||
prevProps.columnIndex === nextProps.columnIndex &&
|
||||
prevProps.data === nextProps.data &&
|
||||
prevProps.columns === nextProps.columns &&
|
||||
prevProps.itemType === nextProps.itemType &&
|
||||
prevProps.enableExpansion === nextProps.enableExpansion &&
|
||||
prevProps.enableHeader === nextProps.enableHeader &&
|
||||
prevProps.startRowIndex === nextProps.startRowIndex
|
||||
);
|
||||
});
|
||||
|
||||
const DefaultRowIndexColumn = (props: ItemTableListInnerColumn) => {
|
||||
const {
|
||||
controls,
|
||||
|
||||
Reference in New Issue
Block a user