From ad796702f52d459812922b06252a13b4be2129ad Mon Sep 17 00:00:00 2001 From: Eric Tse Date: Fri, 9 Jan 2015 17:43:10 -0800 Subject: [PATCH] Fixed small bug where chart rendering triggered by prop changes would use the old values instead of the new values. --- vars.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vars.js b/vars.js index 0d86c43..e09ede0 100644 --- a/vars.js +++ b/vars.js @@ -33,16 +33,16 @@ module.exports = { chart.destroy(); }; - classData.componentWillReceiveProps = function(props) { + classData.componentWillReceiveProps = function(nextProps) { var chart = this.state.chart; chart.destroy(); - this.initializeChart(props); + this.initializeChart(nextProps); }; - classData.initializeChart = function(props) { + classData.initializeChart = function(nextProps) { var el = this.getDOMNode(); var ctx = el.getContext("2d"); - var chart = new Chart(ctx)[chartType](this.props.data, this.props.options || {}); + var chart = new Chart(ctx)[chartType](nextProps.data, nextProps.options || {}); this.state.chart = chart; };