Skip to content

Instantly share code, notes, and snippets.

@joaopalmeiro
Created January 15, 2020 13:29
Show Gist options
  • Select an option

  • Save joaopalmeiro/dba2c41df6e3c23473eeb9a2c1f44f5f to your computer and use it in GitHub Desktop.

Select an option

Save joaopalmeiro/dba2c41df6e3c23473eeb9a2c1f44f5f to your computer and use it in GitHub Desktop.
Lifecycle Methods Wrapping basic skeleton.
class Histogram extends React.Component {
constructor(props) {
super(props);
this.histogramRef = React.createRef();
}
componentDidMount() {
this._createView();
}
componentDidUpdate() {
this._updateView();
}
componentWillUnmount() {
this._clearView();
}
render() {
return <div ref={this.histogramRef} />;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment