I've been facing this warning for a lot of time. Everything works fine, but it keeps saying that it's deprecated. I've been diving into the code to find the current issue and I found out that the problem has to be with the react-draggable dependency that it's used within this project.
To be more precise, the file that is having issues with is /src/components/RangeBox.tsx., in which the draggable library is used. I've been also looking at the library's code in order to find a solution and I found out that in their changelog files they have already contemplated this issue, and they have provided a solution to it.
Down is the text that they have written about this:
4.4.0 (May 12, 2020)
Add nodeRef:
If running in React Strict mode, ReactDOM.findDOMNode() is deprecated.
Unfortunately, in order for <Draggable> to work properly, we need raw access
to the underlying DOM node. If you want to avoid the warning, pass a nodeRef
as in this example:
Would it be possible to fix this? The solution itself is quite easy as it only requires adding a prop with the ref variable as stated in the example provided by the developers.
I've been facing this warning for a lot of time. Everything works fine, but it keeps saying that it's deprecated. I've been diving into the code to find the current issue and I found out that the problem has to be with the react-draggable dependency that it's used within this project.
To be more precise, the file that is having issues with is
/src/components/RangeBox.tsx
., in which the draggable library is used. I've been also looking at the library's code in order to find a solution and I found out that in their changelog files they have already contemplated this issue, and they have provided a solution to it.Down is the text that they have written about this:
4.4.0 (May 12, 2020)
nodeRef
:<Draggable>
to work properly, we need raw access to the underlying DOM node. If you want to avoid the warning, pass anodeRef
as in this example:Would it be possible to fix this? The solution itself is quite easy as it only requires adding a prop with the ref variable as stated in the example provided by the developers.
Thanks in advance.