Created
May 2, 2019 15:42
-
-
Save gpDA/3042c849793364f36d30ff28feb75b3e to your computer and use it in GitHub Desktop.
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
// ./components/Chart/Chart.js | |
// APPEND the updated new value to the end of state | |
// increment counter | |
updateArray(){ | |
this.setState({ | |
inital_line_1: [ | |
...this.state.inital_line_1, | |
this.props.counters[0].value | |
], | |
inital_line_2: [ | |
...this.state.inital_line_2, | |
this.props.counters[1].value | |
], | |
inital_line_3: [ | |
...this.state.inital_line_3, | |
this.props.counters[2].value | |
], | |
counter: this.state.counter + 1 | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment