From 80f17196504590cfb1d69405810c45260cba5ba4 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 25 May 2018 19:20:42 -0400 Subject: [PATCH] Fixed shouldComponentUpdate Ensure the function always returns true or false --- src/chart.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/chart.js b/src/chart.js index 4b32600..a46f076 100644 --- a/src/chart.js +++ b/src/chart.js @@ -131,11 +131,14 @@ export default class Chart extends React.Component { width != nextProps.width || !isEqual(options, nextProps.options) || !isEqual(plugins, nextProps.plugins)) { + var chart = this.state.chart if (nextProps.redraw) { chart.destroy() this.initializeChart(nextProps) - } else { + return true + } + else { var dataKey = nextProps.dataKey || dataKeys[chart.config.type] updatePoints(nextProps, chart, dataKey) if (chart.scales) { @@ -145,6 +148,7 @@ export default class Chart extends React.Component { return false } } + return false } handleOnClick = (event) => {