-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
console.js:273 Warning: findDOMNode is deprecated and will be removed in the next major release. #749
Comments
yes, We also face same error
React next major version don't have "FindDOMNode"
react-draggable should update there package ! |
same here |
You can use the |
@floriancargoet the suggested fix in the readme does not fully cover all use cases. Or at least I struggle to make it work. Image you want to use a react component in absolute positioning and it should be centered. After a few tries I couldn't find a way to include the suggested fixes, keep it draggable and still have it absolute positioned. Here is a codebox to see what problem I try to describe. I could also open a new issue if you want me too, since my case is more specific, but in the end I came from the same origin. |
I have the same issue and I have tried using nodeRef according to the sample code at https://stackoverflow.com/questions/63603902/finddomnode-is-deprecated-in-strictmode-finddomnode-was-passed-an-instance-of-d. So, if using nodeRef is the only solution, this library is not good for me and I have to find another drag & drop library. |
According to react-grid-layout/react-draggable#749 (comment) and https://github.com/react-grid-layout/react-draggable?tab=readme-ov-file#draggable-props this is a workaround to avoid the following warning: ``` Warning: findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node ```
@fujiokae did you find a good alternative that works well with resizable? |
There is another component where I implement sortable elements with dnd-kit (https://dndkit.com/). This component is not resizable, though. But at least dnd-kit does not have the "findDOMNode is deprecated" issue. I will try dnd-kit for my draggable & resizable component later. |
same error,but i fixed it by this import React from 'react'; class MyComponent extends React.Component { componentDidMount() { render() { 拖动我 {/* 将 ref 添加到元素上 */}); } } |
terrible shake is solved by adding |
This warning comes up now, and relates to "DraggableCore". This appears to be you...
Are you aware?
The text was updated successfully, but these errors were encountered: