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

Commit 0c34a41

Browse files
committed
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 48b388a commit 0c34a41

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
@@ -3,6 +3,7 @@ var ReactDOM = require('react-dom');
33

44
module.exports = {
55
createClass: function(chartType, methodNames, dataKey) {
6+
var excludedProps = ['data', 'options', 'redraw'];
67
var classData = {
78
displayName: chartType + 'Chart',
89
getInitialState: function() { return {}; },
@@ -12,7 +13,7 @@ module.exports = {
1213
};
1314
for (var name in this.props) {
1415
if (this.props.hasOwnProperty(name)) {
15-
if (name !== 'data' && name !== 'options') {
16+
if (excludedProps.indexOf(name) === -1) {
1617
_props[name] = this.props[name];
1718
}
1819
}

0 commit comments

Comments
 (0)