Open
Description
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 nodeRef
here 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:
findDOMNode() {
var _this$props$nodeRef$c, _this$props;
return (_this$props$nodeRef$c = (_this$props = this.props) === null || _this$props === void 0 || (_this$props = _this$props.nodeRef) === null || _this$props === void 0 ? void 0 : _this$props.current) !== null && _this$props$nodeRef$c !== void 0 ? _this$props$nodeRef$c : _reactDom.default.findDOMNode(this);
}
I have some tests proving this here.
Metadata
Metadata
Assignees
Labels
No labels