fix: boards rerender optimization
This commit is contained in:
@ -61,7 +61,7 @@ const SortableDnd = <T extends BaseItem>({
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
setItems(sortByLexorank(initialItems));
|
||||
setItems(initialItems);
|
||||
}, [initialItems]);
|
||||
|
||||
const sensors = useDndSensors();
|
||||
|
||||
@ -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>
|
||||
|
||||
Reference in New Issue
Block a user