react-cytoscapejs icon indicating copy to clipboard operation
react-cytoscapejs copied to clipboard

findDOMNode is deprecated in StrictMode

Open ThomasThelen opened this issue 3 years ago • 1 comments

I found the following error in the console and tracked it down to react-cytoscapejs.

 state = {
    w: 0,
    h: 0,
    elements: []
  }

  render() {
    return (
      <div className="home-body">
        <div className="home-graph">
        <CytoscapeComponent
            elements={this.state.elements}
        />
   )
}
react-dom.development.js:86 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of t 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 t (http://localhost:3000/static/js/bundle.js:102627:10)
    at div
    at div
    at Home (http://localhost:3000/main.3b759290fa841003e5d5.hot-update.js:30:5)
    at Routes (http://localhost:3000/static/js/bundle.js:55262:5)
    at div
    at div
    at Router (http://localhost:3000/static/js/bundle.js:55195:15)
    at BrowserRouter (http://localhost:3000/static/js/bundle.js:54004:5)
    at App

ThomasThelen avatar May 15 '22 19:05 ThomasThelen

This is fixed by PR https://github.com/plotly/react-cytoscapejs/pull/53, but it is not yet pushed to the npm registry.

I fixed it in my local project by pointing the package to that commit: yarn add https://github.com/plotly/react-cytoscapejs#ca1cf24c01af69a96f4002e1adc9ddae44b67ce5.

TheAfroOfDoom avatar Jun 08 '22 02:06 TheAfroOfDoom

v2.0.0 published last week contains this fix. Apologies for the confusion and delay.

alexcjohnson avatar Sep 06 '22 22:09 alexcjohnson