Last active
February 14, 2017 18:08
-
-
Save classiemilio/7f3acf2f107c6baac94d56de1a21e5ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const React = require(‘react’); | |
const ReactDOM = require(‘react-dom’); | |
class MyGraphComponent extends React.Component { | |
componentDidMount() { | |
/* D3 code to append elements to this.svg */ | |
} | |
shouldComponentUpdate() { | |
return false; // This prevents future re-renders of this component | |
} | |
render() { | |
return ( | |
<svg ref={(elem) => { this.svg = elem; }} /> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment