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

Commit

Permalink
Fix: unknown prop 'redraw' warning in React v15.2
Browse files Browse the repository at this point in the history
React v15.2 warns when a DOM element is rendered with an invalid property (see https://fb.me/react-unknown-prop)
  • Loading branch information
strawbrary committed Jul 11, 2016
1 parent 48b388a commit 0c34a41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var ReactDOM = require('react-dom');

module.exports = {
createClass: function(chartType, methodNames, dataKey) {
var excludedProps = ['data', 'options', 'redraw'];
var classData = {
displayName: chartType + 'Chart',
getInitialState: function() { return {}; },
Expand All @@ -12,7 +13,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];
}
}
Expand Down

0 comments on commit 0c34a41

Please sign in to comment.