Skip to content

Commit 9e6afaa

Browse files
authored
Update nodeRef type for React v19 compatibility (#769)
Fixes #768. See also https://react.dev/blog/2024/04/25/react-19-upgrade-guide#useref-requires-argument. Only a type change is required, because React's typings (DefinitelyTyped) were changed. The implementation in DraggableCore.js itself already tolerates / guard against `.current==null` everywhere.
1 parent 3fc5126 commit 9e6afaa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

typings/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ declare module 'react-draggable' {
5050
offsetParent: HTMLElement,
5151
grid: [number, number],
5252
handle: string,
53-
nodeRef?: React.RefObject<HTMLElement>,
53+
nodeRef?: React.RefObject<HTMLElement | null>,
5454
onStart: DraggableEventHandler,
5555
onDrag: DraggableEventHandler,
5656
onStop: DraggableEventHandler,

0 commit comments

Comments
 (0)