Created
January 15, 2020 13:29
-
-
Save joaopalmeiro/dba2c41df6e3c23473eeb9a2c1f44f5f to your computer and use it in GitHub Desktop.
Lifecycle Methods Wrapping basic skeleton.
This file contains hidden or 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
| 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