File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131 "demo" : " cross-env NODE_ENV=development webpack-serve webpack.config.js --open --open-path demo.html"
3232 },
3333 "peerDependencies" : {
34- "react" : " >=15.0.0" ,
35- "react-dom" : " >=15.0.0"
34+ "react" : " >=15.0.0"
3635 },
3736 "devDependencies" : {
3837 "babel-core" : " ^6.26.0" ,
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import ReactDOM from 'react-dom' ;
32import { types } from './types' ;
43import { defaults } from './defaults' ;
54import Cytoscape from 'cytoscape' ;
@@ -41,10 +40,11 @@ export default class CytoscapeComponent extends React.Component {
4140 constructor ( props ) {
4241 super ( props ) ;
4342 this . displayName = `CytoscapeComponent` ;
43+ this . containerRef = React . createRef ( ) ;
4444 }
4545
4646 componentDidMount ( ) {
47- const container = ReactDOM . findDOMNode ( this ) ;
47+ const container = this . containerRef . current ;
4848
4949 const {
5050 global,
@@ -100,6 +100,7 @@ export default class CytoscapeComponent extends React.Component {
100100 const { id, className, style } = this . props ;
101101
102102 return React . createElement ( 'div' , {
103+ ref : this . containerRef ,
103104 id,
104105 className,
105106 style
You can’t perform that action at this time.
0 commit comments