#React Draggable Error

4 messages · Page 1 of 1 (latest)

cursive heartBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

timid shore
#

Hi the code it self is working but I keep getting the warnings.

"use client";
import Draggable from 'react-draggable'; 
import React from 'react'

export default  function block()
{

    return (
        <div> 
        <h3>GeeksforGeeks - Draggable Components</h3> 
        <Draggable> 
          <div>We can move this text</div> 
        </Draggable> 
      </div> 
    )
}
#
app-index.js:32 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of DraggableCore which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here:
#
"use client";
import Draggable from 'react-draggable'; 
import React from 'react'

export default  function block()
{
  const nodeRef = React.useRef(null);

    return (
        <div> 
        <h3>GeeksforGeeks - Draggable Components</h3> 
        <Draggable nodeRef={nodeRef}> 
          <div ref={nodeRef}>We can move this text</div> 
        </Draggable> 
      </div> 
    )
}