You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
nodeRef solution for React 19 does not work due to incorrect build output #779
The recommended solution for the React 19 findDOMNode removal is to provide a DOM element reference via nodeRef. This does not work due to how react-draggable is being built.
The check being done for provided nodeRefhere falls back to using ReactDOM.findDOMNode when nodeRef is an empty ref ({ current: null }), which is always the initial value for DOM refs.
The source code appears to be doing the correct thing and should not result in this behavior, but the compiled code changes the behavior:
Reacted by Abdul Raffay S., Amjad Kayed, Rio Ferdinand Martino, Mateusz Picheta, Dumerchat Kyrill, Nathan Rocha, Shidqon Famulaqih, Vitaliy, Alejandro Elias, Luiz Cieslak and 1 more
Fixed as of 4.6.0. findDOMNode() now checks whether the nodeRef prop exists, not whether nodeRef.current is set, so a {current: null} ref no longer falls through to ReactDOM.findDOMNode. Your useRef({}) workaround is no longer needed.
Activity
rhyek commentedon Apr 27, 2025
Setting an initial value works:
STRML commentedon Sep 27, 2026
Fixed as of 4.6.0.
findDOMNode()now checks whether thenodeRefprop exists, not whethernodeRef.currentis set, so a{current: null}ref no longer falls through toReactDOM.findDOMNode. YouruseRef({})workaround is no longer needed.