Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Commit 554885a

Browse files
committed
Merge pull request #1 from erictse/master
Potential bug fix with prop updates not rerendering with new data
2 parents 42eed23 + ad79670 commit 554885a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

vars.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ module.exports = {
3333
chart.destroy();
3434
};
3535

36-
classData.componentWillReceiveProps = function(props) {
36+
classData.componentWillReceiveProps = function(nextProps) {
3737
var chart = this.state.chart;
3838
chart.destroy();
39-
this.initializeChart(props);
39+
this.initializeChart(nextProps);
4040
};
4141

42-
classData.initializeChart = function(props) {
42+
classData.initializeChart = function(nextProps) {
4343
var el = this.getDOMNode();
4444
var ctx = el.getContext("2d");
45-
var chart = new Chart(ctx)[chartType](this.props.data, this.props.options || {});
45+
var chart = new Chart(ctx)[chartType](nextProps.data, nextProps.options || {});
4646
this.state.chart = chart;
4747
};
4848

0 commit comments

Comments
 (0)