fix: optimize ArtifactListImpl
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
import { memo } from "react";
|
||||
|
||||
import { type ScheduleArtifact } from "../../services/api";
|
||||
import Icon from "../../components/common/Icon";
|
||||
import { shortHash } from "./utils";
|
||||
|
||||
export function ArtifactList({
|
||||
// 包裹 memo 让父级 SchedulePage 在画布交互(setSelectedNodeId /
|
||||
// setSelectedEdgeId / linkSourceId 等)重渲染时,artifact 卡片不会跟着
|
||||
// 重建/重绑拖拽事件 —— 减少拖动过程中的事件重绑与列表抖动。
|
||||
function ArtifactListImpl({
|
||||
artifacts,
|
||||
keyword,
|
||||
onDrop,
|
||||
@@ -77,3 +82,5 @@ export function ArtifactList({
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
export const ArtifactList = memo(ArtifactListImpl);
|
||||
|
||||
Reference in New Issue
Block a user