Skip to content

Getting Warnings in new React version. #727

Open

Description

@sumitdhakadjobma

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: https://reactjs.org/link/strict-mode-find-node
at div
at DraggableCore (http://localhost:3000/static/js/vendors-node_modules_react-draggable_build_cjs_cjs_js.chunk.js:1156:5)
at Draggable (http://localhost:3000/static/js/vendors-node_modules_react-draggable_build_cjs_cjs_js.chunk.js:447:5)
at VoiceCommand (http://localhost:3000/static/js/src_modules_Interview_FirstTheme_VoiceCommand_VoiceCommand_js.chunk.js:35:5)
at Suspense
at VoiceCommand
.......
.......
.......
(hide content)

Activity

  1. BrianAA commented on Aug 6, 2023

    @BrianAA

    While what you say is true I also get that error. You can also just drop the strict and just use the . It cleared the problem for me.

    ReactDOM.createRoot(document.getElementById("root")).render(
        <App />
    );

    Instead of

    ReactDOM.createRoot(document.getElementById("root")).render(
       <React.Strict>
        <App />
       </React.Strict>
    );
  2. z89 commented on Aug 8, 2023

    @z89

    While what you say is true I also get that error. You can also just drop the strict and just use the . It cleared the problem for me.

    ReactDOM.createRoot(document.getElementById("root")).render(
        <App />
    );

    Instead of

    ReactDOM.createRoot(document.getElementById("root")).render(
       <React.Strict>
        <App />
       </React.Strict>
    );

    This is a bad practise since developers use StrictMode for testing. Any other solutions?

  3. Dream4ever commented on Aug 20, 2023

    @Dream4ever

    @sumitdhakadjobma @z89 check out this issue: #693

  4. SiddHyper commented on Oct 4, 2023

    @SiddHyper

    +1

  5. designbyadrian commented on Oct 31, 2023

    @designbyadrian

    +1

    No need to type "+1", just vote with the the icon on the original post. This way, devs can search and sort for issues.

  6. gabrielyotoo commented on Feb 7, 2024

    @gabrielyotoo

    still an issue

  7. jmw182 commented on Mar 26, 2024

    @jmw182
  8. yelvert commented on Apr 14, 2024

    @yelvert

    passing in a nodeRef does not always fix this issue, I think

      findDOMNode(): ?HTMLElement {
        return this.props?.nodeRef?.current ?? ReactDOM.findDOMNode(this);
      }
    

    should become

      findDOMNode(): ?HTMLElement {
        return this.props?.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);
      }
    

    becaus the problem is that nodeRef's current value isnt always set yet when findDOMNode is called

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions