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

Commit 381b53b

Browse files
strawbrarymiracle2k
authored andcommitted
Fix: unknown prop 'redraw' warning in React v15.2
React v15.2 warns when a DOM element is rendered with an invalid property (see https://fb.me/react-unknown-prop)
1 parent da9f718 commit 381b53b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/core.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var Chart = require('chart.js');
1111

1212
module.exports = {
1313
createClass: function(chartType, methodNames, dataKey) {
14+
var excludedProps = ['data', 'options', 'redraw'];
1415
var classData = {
1516
displayName: chartType + 'Chart',
1617
getInitialState: function() { return {}; },
@@ -20,7 +21,7 @@ module.exports = {
2021
};
2122
for (var name in this.props) {
2223
if (this.props.hasOwnProperty(name)) {
23-
if (name !== 'data' && name !== 'options') {
24+
if (excludedProps.indexOf(name) === -1) {
2425
_props[name] = this.props[name];
2526
}
2627
}

0 commit comments

Comments
 (0)