Skip to content

Commit 3784e04

Browse files
committed
refactor: use existing id prop
1 parent aacd8bf commit 3784e04

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/ChessboardProvider.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
use,
1717
useCallback,
1818
useEffect,
19-
useId,
2019
useMemo,
2120
useRef,
2221
useState,
@@ -302,7 +301,7 @@ export function ChessboardProvider({
302301
const animationTimeoutRef = useRef<NodeJS.Timeout | null>(null);
303302

304303
// unique id for dnd context, we need this to prevent hydration issues
305-
const dndId = useId();
304+
const dndId = `dnd-${id}`;
306305

307306
// if the position changes, we need to recreate the pieces array
308307
useEffect(() => {

0 commit comments

Comments
 (0)