-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove extra unknown props #2
Conversation
@@ -150,16 +150,23 @@ var NumberFormat = React.createClass({ | |||
this.onChangeHandler(e, this.props.onInput); | |||
}, | |||
render: function render() { | |||
var props = this.props; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this changes on src files instead of lib?
@@ -150,16 +150,23 @@ var NumberFormat = React.createClass({ | |||
this.onChangeHandler(e, this.props.onInput); | |||
}, | |||
render: function render() { | |||
var props = this.props; | |||
var props = _extends({}, {}, this.props); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why double objects. It can be just
var props = _extends({}, this.props);
Also we can minimze by code by
['thousandSeperator', 'suffix', 'prefix', /* 'all others custom props' */].forEach((key) => {
delete props[key];
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So lib files are generated files, you don't have to manually change it. Plus the changes in lib file and src files are different.
Ok let me make those changes and commit it.
For future fixes can you follow the development guide mentioned in readme. Let me know if you find any difficulty setting it up locally. |
https://facebook.github.io/react/warnings/unknown-prop.html