fix: boards rerender optimization

This commit is contained in:
2025-08-21 16:45:04 +04:00
parent f3df8840df
commit cb67c913ad
9 changed files with 51 additions and 83 deletions

View File

@ -61,7 +61,7 @@ const SortableDnd = <T extends BaseItem>({
);
useEffect(() => {
setItems(sortByLexorank(initialItems));
setItems(initialItems);
}, [initialItems]);
const sensors = useDndSensors();

View File

@ -1,5 +1,6 @@
import React, { CSSProperties, ReactNode } from "react";
import { useDraggable } from "@dnd-kit/core";
import useIsMobile from "@/hooks/useIsMobile";
type Props = {
id: number | string;
@ -13,6 +14,7 @@ const DragHandle = ({ id, children, style, disabled }: Props) => {
id,
disabled,
});
const isMobile = useIsMobile();
return (
<div
@ -24,6 +26,7 @@ const DragHandle = ({ id, children, style, disabled }: Props) => {
touchAction: "auto",
...style,
}}
className={isMobile ? "" : "swiper-no-swiping"}
ref={setNodeRef}>
{children}
</div>