From 5835276c50703cd008b11c564a9a5b9bd611512d Mon Sep 17 00:00:00 2001 From: Michael Plakhov Date: Thu, 15 Dec 2016 14:00:08 +0200 Subject: [PATCH] Fix: unknown prop 'redraw' warning in React v15.2 Transfer of this commit https://github.com/reactjs/react-chartjs/commit/0c34a416d191a2289f1c1dd290d49c5f8e8b570c --- lib/core.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/core.js b/lib/core.js index 3c06eac..3a0069d 100644 --- a/lib/core.js +++ b/lib/core.js @@ -11,6 +11,7 @@ var Chart = require('chart.js'); module.exports = { createClass: function(chartType, methodNames, dataKey) { + var excludedProps = ['data', 'options', 'redraw']; var classData = { displayName: chartType + 'Chart', getInitialState: function() { return {}; }, @@ -20,7 +21,7 @@ module.exports = { }; for (var name in this.props) { if (this.props.hasOwnProperty(name)) { - if (name !== 'data' && name !== 'options') { + if (excludedProps.indexOf(name) === -1) { _props[name] = this.props[name]; } }