Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/ChessboardProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ export function ChessboardProvider({
// the animation timeout whilst waiting for animation to complete
const animationTimeoutRef = useRef<NodeJS.Timeout | null>(null);

// unique id for dnd context, we need this to prevent hydration issues
const dndId = `dnd-${id}`;

// if the position changes, we need to recreate the pieces array
useEffect(() => {
const newPosition =
Expand Down Expand Up @@ -667,6 +670,7 @@ export function ChessboardProvider({
onDragEnd={handleDragEnd}
onDragCancel={handleDragCancel}
sensors={sensors}
id={dndId}
>
{children}
</DndContext>
Expand Down