Skip to content
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

Open
HenrikBechmann opened this issue Apr 27, 2024 · 4 comments

Comments

@HenrikBechmann
Copy link

This warning comes up now, and relates to "DraggableCore". This appears to be you...

Are you aware?

Screenshot 2024-04-27 at 9 27 12 AM
@theonlineaid
Copy link

yes, We also face same error

console.js:273 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 http://localhost:5173/node_modules/.vite/deps/chunk-QNSVWXN7.js?v=f5d60d48:758:49
    at Paper2 (http://localhost:5173/node_modules/.vite/deps/chunk-M4MEA2XN.js?v=f5d60d48:119:17)
    at DraggableCore (http://localhost:5173/node_modules/.vite/deps/react-draggable.js?v=f5d60d48:620:9)
    at Draggable (http://localhost:5173/node_modules/.vite/deps/react-draggable.js?v=f5d60d48:1067:9)
    at PaperComponent

React next major version don't have "FindDOMNode"

import { createRef, Component } from 'react';

class AutoselectingInput extends Component {
  inputRef = createRef(null);

  componentDidMount() {
    const input = this.inputRef.current;
    input.select()
  }

  render() {
    return (
      <input ref={this.inputRef} defaultValue="Hello" />
    );
  }
}

react-draggable should update there package !

@yidah
Copy link

yidah commented May 2, 2024

Same error here:
image

@fdemir
Copy link

fdemir commented May 2, 2024

same here

@floriancargoet
Copy link

You can use the nodeRef prop documented in the README, it doesn't use findDOMNode and removes the warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants